-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI command to clear the Thaw cache #62
Comments
Hi @bennyboer , Thanks. |
Hi there, sure you can! Basically all cached stuff is under the user folder For the CLI we use https://picocli.info/ which to my knowledge should have something like subcommands, but I am not that familar with it, so you can live it up as you wish! 😄 Let me know here or via e-mail if you need any help! |
Hi, I tried to run the application with the following command in Ubuntu But I am getting the following erro- ########################
### Thaw Project CLI ###
########################
### Configuration ###
Charset: 'UTF-8'
### Processing ###
Searching for Thaw files within folder at '/home/badal/Documents/codeProject/thaw/cli/../example/demo'...
Processing Thaw info file 'demo.tdi'...
Processing Thaw text file 'demo.tdt'...
Processing Thaw style file 'demo.tds'...
Oct. 14, 2020 10:57:52 P.M. org.apache.fontbox.ttf.CmapSubtable processSubtype14
WARNING: Format 14 cmap table is not supported and will be ignored
An exception occurred while trying to export the resulting document.
The exception message is: 'de.be.thaw.typeset.exception.TypeSettingException: Could not convert the document into the Knuth-Plass algorithm format'
de.be.thaw.export.exception.ExportException: de.be.thaw.typeset.exception.TypeSettingException: Could not convert the document into the Knuth-Plass algorithm format
at de.be.thaw.export.pdf.PdfExporter.export(PdfExporter.java:109)
at de.be.thaw.cli.CLI.call(CLI.java:236)
at de.be.thaw.cli.CLI.call(CLI.java:36)
at picocli.CommandLine.executeUserObject(CommandLine.java:1853)
at picocli.CommandLine.access$1100(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2255)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2249)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2213)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2080)
at picocli.CommandLine.execute(CommandLine.java:1978)
at de.be.thaw.cli.CLI.main(CLI.java:69)
Caused by: de.be.thaw.typeset.exception.TypeSettingException: Could not convert the document into the Knuth-Plass algorithm format
at de.be.thaw.typeset.knuthplass.KnuthPlassTypeSetter.convertToParagraphs(KnuthPlassTypeSetter.java:177)
at de.be.thaw.typeset.knuthplass.KnuthPlassTypeSetter.typesetWithConfig(KnuthPlassTypeSetter.java:89)
at de.be.thaw.typeset.knuthplass.KnuthPlassTypeSetter.typeset(KnuthPlassTypeSetter.java:77)
at de.be.thaw.export.pdf.PdfExporter.typeset(PdfExporter.java:219)
at de.be.thaw.export.pdf.PdfExporter.export(PdfExporter.java:107)
... 10 more
Caused by: de.be.thaw.core.document.convert.exception.DocumentConversionException: de.be.thaw.export.exception.ExportException: Could not find font family 'Arial' in OS installed fonts. If on Windows make sure that the fonts were installed for all users for Thaw to be able to pick it up.
at de.be.thaw.typeset.knuthplass.converter.context.ConversionContext.appendTextToParagraph(ConversionContext.java:198)
at de.be.thaw.typeset.knuthplass.converter.KnuthPlassConverter.initializeTextualNode(KnuthPlassConverter.java:153)
at de.be.thaw.typeset.knuthplass.converter.KnuthPlassConverter.initializeForNode(KnuthPlassConverter.java:118)
at de.be.thaw.typeset.knuthplass.converter.KnuthPlassConverter.initializeForNode(KnuthPlassConverter.java:126)
at de.be.thaw.typeset.knuthplass.converter.KnuthPlassConverter.initializeForNode(KnuthPlassConverter.java:126)
at de.be.thaw.typeset.knuthplass.converter.KnuthPlassConverter.convert(KnuthPlassConverter.java:100)
at de.be.thaw.typeset.knuthplass.KnuthPlassTypeSetter.convertToParagraphs(KnuthPlassTypeSetter.java:175)
... 14 more
Caused by: de.be.thaw.export.exception.ExportException: Could not find font family 'Arial' in OS installed fonts. If on Windows make sure that the fonts were installed for all users for Thaw to be able to pick it up.
at de.be.thaw.export.pdf.util.ExportContext.lambda$getFontVariantLocatorForStyleValue$0(ExportContext.java:322)
at java.base/java.util.Optional.orElseThrow(Optional.java:401)
at de.be.thaw.export.pdf.util.ExportContext.getFontVariantLocatorForStyleValue(ExportContext.java:322)
at de.be.thaw.export.pdf.util.ExportContext.getFontForNode(ExportContext.java:363)
at de.be.thaw.export.pdf.PdfExporter$3.getSpaceWidth(PdfExporter.java:270)
at de.be.thaw.typeset.knuthplass.converter.context.ConversionContext.appendTextToParagraph(ConversionContext.java:193)
... 20 more
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cli:run'.
> Process 'command '/home/badal/.jabba/jdk/openjdk@1.14.0/bin/java'' finished with non-zero exit value 4 Not sure if I need to do any additional set up. |
Nothing wrong except for the font 😄 It says:
Since I was running the demo on Windows, I have set the font to Arial, so you have to find a font that is installed on your system or use another font (ending with *.ttf, since *.oft fonts are currently not supported). If you want to use an *.oft font you may just convert it to *.ttf since the only difference is how the glyphs are stored (Google "OTF to TTF online" for example). However for Linux-Distributions Thaw will look into the following folders to find fonts:
You can then update the file Alternatively you could just point those properties to a folder of font files using something like Hope it helps! |
I changed the font-family: Ubuntu:url(/usr/share/fonts/truetype/ubuntu/);
inline-code-font-family: Ubuntu:url(usr/share/fonts/truetype/ubuntu/); But I am getting the following error- ### Processing ###
Searching for Thaw files within folder at '/home/badal/Documents/codeProject/thaw/cli/../example/demo'...
Processing Thaw info file 'demo.tdi'...
Processing Thaw text file 'demo.tdt'...
Processing Thaw style file 'demo.tds'...
An exception occurred while trying to parse the provided style file at '/home/badal/Documents/codeProject/thaw/cli/../example/demo/demo.tds'.
The exception message is: 'de.be.thaw.style.parser.value.exception.StyleValueParseException: Could not resolve font file at 'usr/share/fonts/truetype/ubuntu/''
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cli:run'.
> Process 'command '/home/badal/.jabba/jdk/openjdk@1.14.0/bin/java'' finished with non-zero exit value 8
My directory has the following contents- It says, it can't resolve the font file. But the files are in the folder. Any idea what can be wrong? I will also switch to Windows in the meantime and finish #62. |
Hi there, I tested now on Ubuntu as well and had to fix some Font-related stuff. My current working
I had to use DejaVu Serif for the document font-family because there is an unordered enumeration in the document that wants to use the asterisk operator character as item symbol, which Ubuntu does not have. Unfortunately there are some display problems with DejaVu Serif with uppercase letters. Probably should investigate that at some point 😄 . You will have to install python and pygments as well (sudo apt-get install python3 python3-pygments) because the demo document uses syntax highlighting for code blocks. Other than that it is working! |
Would be useful to be able to clear the Thaw cache under
~/.thaw
with a CLI command:thaw clean
The text was updated successfully, but these errors were encountered: