-
Notifications
You must be signed in to change notification settings - Fork 7
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
How to add a new font to support Cyrillic? #9
Comments
Hi, Perhaps @pkamenarsky knows more about this topic as he made changed related to fonts in HPDF? |
Did you ever figure this out? I also notice I don't get subscripts, e.g. with alpheccar#12 said to have patience back in 2016 🧐 |
No. I couldn't figure out. I have tried many different There is a TODO.txt file which says that " |
I tried printing a file with ₂₁₃₀₅ to pdf from firefox and opening the pdf in fontforge, it showed e.g. ₂ being SUBSCRIPT TWO so that looked right, then I did File→Generate→PS1(binary) to generate a pfb+afm and loaded it into https://github.com/hsyl20/HPDF/blob/master/Test/onepage.hs (changing debugtext to ₂₁₃₀₅ and font paths to my generated pfb+afm), but I just got ☐☐☐☐☐'s. So it really does seem like there's Something missing with respect to unicode (though I don't understand what it would have to do with bidi) |
I grepped for 2080 (₀) in the .afm and found
and using the extracted .afm/.pfb I did actually get the subscripts to display. https://github.com/hsyl20/HPDF/blob/master/Graphics/PDF/Fonts/Encoding.hs#L67-L74 seems to be the relevant code. So what would be a good API for this? I can imagine some function which takes a text and creates a list like the above and makes an Encoding out of it, but one can't trust that Ideally simply loading the font would give it the right |
Hello.
As I understand, the standard fonts provided by "
Graphics.PDF.Fonts.Standard.Font
" do not provide support for Cyrillic.So I followed the HPDF/Test/onepage.hs example without success. The generated
.pdf
does not display Cyrillic text.I have tried several other fonts besides
DroidSans
:OpenSans
,DejaVuSans
,FreeSerif
,TimesNewRoman
, all without success.Note that I used
fontforge
to convert.ttf
to.pfb
and.afm
files as below:$ fontforge -lang=ff -c 'Open($1); Generate($2); Close();' DroidSans.ttf DroidSans.pfb
Some of them had issues with underscores (i.e. "
_
") and numeric digits (like "6
") in.amf
files when parsed withHPDF
.Is there anything else besides the example given on HPDF/Test/onepage.hs?
Or maybe it needs to be done in a completely different way?
Env:
Thanks.
The text was updated successfully, but these errors were encountered: