Pango and freetype2 =?UTF-8?Q?charmap=3F?=
- From: mathog <mathog caltech edu>
- To: <gtk-i18n-list gnome org>
- Subject: Pango and freetype2 charmap?
- Date: Mon, 12 Mar 2012 15:28:14 -0700
Still trying to track down the issue with glyph's not mapping 1:1 with
Symbol fonts. Could not reproduce
the problem in a test program (it was not picking up Symbol font at
all) so have been working on it in Inkscape trunk.
Traced part of the issue to this area of
inkscape/src/libnrtype/FontInstance.cpp:
theFace=pango_ft2_font_get_face(pFont); // Deprecated, use
pango_fc_font_lock_face() instead
if ( theFace ) {
FT_Select_Charmap(theFace,ft_encoding_unicode) &&
FT_Select_Charmap(theFace,ft_encoding_symbol);
}
Put some debug statements like these
for(i=0x70;i<0xB0;i+=16){
myfile << std::hex << i ;
for(j=i;j<i+16;j++){
myfile << " " << std::hex << FT_Get_Char_Index(theFace,j);
}
myfile <<endl;
}
above and below the FT_Select_Charmap and found
BEFORE
70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
in font_instance::InitTheFace set charmap FontName SymbolMT status 0
AFTER
70 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 0
80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a0 0 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
Then commented out the FT_Select_charmap and found:
70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
in font_instance::InitTheFace commented out - no action
AFTER
70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The glyphs used to actually draw the letters were the same in both of
these cases, and were NOT the ones listed above
in the FreeType charmap (for characters >7E && <FF). It seems Pango is
using its own character map
values to derive glyph ids and ignoring the ones set with Freetype.
For instance, character value A8 maps
to glyph 109 (decimal) = 0x6D, not the 0 or 6a shown above. This could
be seen by putting print statements
in the font_instance::LoadGlyph method.
The SymbolMT font reports (via freetype) that it supports both Apple
Roman and MS_SYMBOL (not unicode), but changing it to either one of
those with FT_Select_Charmap made no difference at all in what Inkscape
displayed.
Where is the charmap pango is using???
(Pango 1.28.3, Freetype 2.4.2)
Thanks,
David Mathog
mathog caltech edu
Manager, Sequence Analysis Facility, Biology Division, Caltech
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]