ClementGre / PDF4Teachers

PDF editing software in large quantities. Designed for teachers, this app keeps recorded previous annotations, and offers features like marking scale, PDF conversion, vectorial drawing...
https://pdf4teachers.org/
Apache License 2.0
140 stars 17 forks source link

Offer system fonts / Allow to add custom fonts #86

Closed MeisterLLD closed 3 years ago

MeisterLLD commented 3 years ago

Describe the bug On my Linux (non deb) version, only some fonts are here (OpenSans, Jost, Lato Black...) but for instance Gentium, Symbola, Mononoki Nerd Font, Noto Emoji which are all present on my system (and for instance in LibreOffice Writer) are not in PDF4Teachers's font list. Fonts already present are ok, but I would like for instance the emoji support of Symbola. For instance right now in PDF4Teachers no font can display the warning sign emoji ⚠️.

To Reproduce Steps to reproduce the behavior:

  1. Install a new font and do fc-cache
  2. Check if font is present in PDF4Teacher's list

Desktop (please complete the following information):

ClementGre commented 3 years ago

Hi @MeisterLLD, currently, PDF4Teachers does not support system fonts, but only fonts that I chose myself, because when exporting a document, I have to add the .ttf file to the PDF, and it was too complicate to get a system font as a .ttf file.

I will see if I can add a support for taking in account the system fonts, and in case it is too hard, I will allow the users to add custom fonts.

Thank you, Clément

MeisterLLD commented 3 years ago

Thanks, I understand why this might be difficult. Maybe just adding a font with a good emoji support would be enough for most users ?

ClementGre commented 3 years ago

Hi @MeisterLLD, maybe I spent too much time on this, but now, PDF4Teachers can fully read system fonts. There could still be some issues, like the source folders, on Linux, it is:

~.fonts /usr/share/fonts/truetype /usr/share/fonts/TTF

Also, not all types of fonts are supported, only TTF and TTC. Moreover, fonts have to have a header table (and not all have one).

Fonts will be indexed and then cached. to reload the fonts, you will need to go to the settings. You will be able to test this feature during the 1.3.0 pre-release.

Thank you, Clément.

ClementGre commented 3 years ago

By the way, not all emojis fonts are supported. On Windows, Simbol does not works right. Moreover, colored fonts are not supported so emojis will have a bad look.

With the font Twitter Color Emoji, you can get something like this: image