[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Having trouble rendering emojis with FreeType (Re: Freety
From: |
Hin-Tak Leung |
Subject: |
Re: [ft-devel] Having trouble rendering emojis with FreeType (Re: Freetype-devel Digest, Vol 172, Issue 22) |
Date: |
Fri, 17 May 2019 09:31:05 +0000 (UTC) |
--------------------------------------------
On Thu, 16/5/19, Moazin Khatri <address@hidden> wrote:
> Yea, it was stupid of me to try
> setting the size of a bitmap embedded font, whose glyphs are
> fixed size. Lesson learned! :)
I learned that only somewhat recently, a couple of years ago, when I took on
FontVal - and that's after about 2 decades of interests in Freetype. Never too
late to learn something :-).
> Also, as far as I understand now,
> with the case of bitmap embedded fonts, a user can look
> inside `face->available_sizes' to list all
> the available sizes and then set the one the user desires.
> Am I correct?
> Regards,Moazin
If you look at the source of ftdump (part of ft2-demos), you'd likely have your
answer.
Running ftdump on NotoColorEmoji on ubuntu, gives this section:
$ftdump /usr/share/fonts/truetype/noto/NotoColorEmoji.ttf
...
fixed size
0: height 128, width 136
size 109.000, x_ppem 109.000, y_ppem 109.000
...
'ftdump /usr/lib/thunderbird/fonts/EmojiOneMozilla.ttf' does not show a "fixed
size" section.
I don't have the Apple Emoji font on the computer I am typing on right now, but
if I remember correctly, it contains about 3 or 4 fixed bitmap sizes.
The two freetype-py Emoji rendering examples are :
https://github.com/rougier/freetype-py/blob/master/examples/emoji-color.py
and
https://github.com/rougier/freetype-py/blob/master/examples/emoji-color-cairo.py
I left a comment for myself and others on line 21,22 in the latter :-) :
# Not all char sizes are valid for emoji fonts;
# Google's NotoColorEmoji only accept size 109 to get 136x128 bitmaps