bennyboer / thaw

Hierarchical organizable and versionable document tool with export to PDF
MIT License
4 stars 1 forks source link

Allow adding a font file instead of just the name in the style file #48

Closed bennyboer closed 3 years ago

bennyboer commented 3 years ago

I want to add a custom font file in the style file:

document {
  font-family: url(my-font-file.ttf);
}
bennyboer commented 3 years ago

Example

For all font-family properties you can not specify the font family name as well as the URL of where to find a bunch of font files (or just one).

font-family: Playfair Display:url(res/fonts/playfair_display); is an example.

TDS

document {
  font-family: Playfair Display:url(res/fonts/playfair_display); // When specifying a folder, all the included font files will be added to the Thaw font manager (the preferred font-variant from the font-variant property will be used)
  inline-code-font-family: Consolas;
  line-number-font-family: Playfair Display:url(res/fonts/playfair_display/PlayfairDisplay-Medium.ttf); // Specify a file directly thus overriding the preferred font variant set by the font-variant property
}