Bug 93873 - FcPatternGetString() does not return "TrueType" for FC_FONTFORMAT on Solaris 10 SPARC
Summary: FcPatternGetString() does not return "TrueType" for FC_FONTFORMAT on Solaris ...
Status: RESOLVED NOTABUG
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.11
Hardware: SPARC Solaris
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-26 11:38 UTC by Matthias Apitz
Modified: 2016-01-28 06:36 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
output of fc-match on SPARC (14.89 KB, text/plain)
2016-01-28 06:20 UTC, Matthias Apitz
Details

Description Matthias Apitz 2016-01-26 11:38:59 UTC
I detected this while porting cups-filters to Linux and SPARC. On Linux 
it is fine, while on SPARC "TrueType" is not returned as FC_FORMAT for the same TTF file as used on Linux. Details are:


cups-filter's texttopdf makes a call like this:

     FcPatternGetString  (candidates->fonts[i], FC_FONTFORMAT, 0, &fontformat);

and does not get a valid pointer in fontformat, it returns 0x0;

I have fontconfig 2.11.91 compiled from source and installed on Linux
and SPARC and compared what the tool 'fc-match' on both systems see
about the same file /usr/share/fonts/FreeFont/FreeMono.ttf. In SPARC the
information about 'fontformat' is not returned and due to this
cups-filter' texttopdf failes.


SPARC:

/usr/local/sisis-pap/cups2/bin/fc-match -V                   
fontconfig version 2.11.91

Linux:

/usr/local/bin/fc-match -V
fontconfig version 2.11.91

SPARC:

/usr/local/sisis-pap/cups2/bin/fc-match -s -v FreeMono | fgrep -i fontformat
(no match in grep)

Linux:

/usr/local/bin/fc-match -s -v FreeMono | fgrep -i fontformat
	fontformat: "TrueType"(w)

SPARC:

/usr/local/sisis-pap/cups2/bin/fc-match -s -v FreeMono

Pattern has 33 elts (size 48)
	family: "FreeMono"(s)
	familylang: "en"(s)
	style: "Medium"(s) "нормален"(s) "Normal"(s) "obyčejné"(s) "Standard"(s) "µεσαία"(s) "Normaali"(s) "Normál"(s) "Normale"(s) "Standaard"(s) "Normalny"(s) "Обычный"(s) "Normálne"(s) "menengah"(s) "прямій"(s) "navadno"(s) "vidējs"(s) "normalusis"(s) "thường"(s) "Arrunta"(s)
	stylelang: "en"(s) "bg"(s) "ca"(s) "cs"(s) "de"(s) "el"(s) "fi"(s) "hu"(s) "it"(s) "nl"(s) "pl"(s) "ru"(s) "sk"(s) "id"(s) "uk"(s) "sl"(s) "lv"(s) "lt"(s) "vi"(s) "eu"(s)
	fullname: "Free Monospaced"(s)
	fullnamelang: "en"(s)
	slant: 0(i)(s)
	weight: 80(i)(s)
	width: 100(i)(s)
	size: (0, 1.79769e+308)(s)
	pixelsize: 12.5(f)(s)
	spacing: 100(i)(w)
	foundry: "unknown"(w)
	hintstyle: 3(i)(s)
	hinting: True(s)
	verticallayout: False(s)
	autohint: False(s)
	globaladvance: True(s)
	file: "/usr/share/fonts/FreeFont/FreeMono.ttf"(w)
	index: 0(i)(w)
	outline: True(w)
	scalable: True(w)
	dpi: 75(f)(s)
	scale: 1(f)(s)
	charset: 
	0000: 00000000 00000001 00000000 00000000 00000000 00002001 00000000 00000000
	0003: 00000000 00000000 00008000 00000000 00000000 00000000 00000000 00000000
	0006: 10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	0011: 00000000 00000000 80000000 00000001 00000000 00000000 00000000 00000000
	0016: 00000000 00000000 00000000 00000000 00000001 00000000 00000000 00000000
	0017: 00000000 00000000 00000000 00000000 00000000 00300000 00000000 00000000
	0018: 00007800 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	0020: 0000ffff 0000fc00 80000000 0000ffdf 00000000 00000000 00000000 00000000
	0028: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	0030: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	0031: 00000000 00000000 00000000 00000010 00000000 00000000 00000000 00000000
	00fe: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 80000000
	00ff: 00000000 00000000 00000000 00000000 00000000 00000001 00000000 00000000
	01bc: 00000000 00000000 00000000 00000000 00000000 0000000f 00000000 00000000
(w)
	lang: (s)
	fontversion: 79626(i)(s)
	capability: "otlayout:grek otlayout:hebr otlayout:latn"(w)
	embeddedbitmap: True(s)
	decorative: False(s)
	namelang: "en"(s)
	prgname: "fc-match"(s)
	postscriptname: "FreeMono"(w)


Linux:

/usr/local/sisis-pap/cups2/bin/fc-match -s -v FreeMono
Pattern has 35 elts (size 48)
	family: "FreeMono"(s)
	familylang: "en"(s)
	style: "Medium"(s) "нормален"(s) "Normal"(s) "obyčejné"(s) "Standard"(s) "µεσαία"(s) "Normaali"(s) "Normál"(s) "Normale"(s) "Standaard"(s) "Normalny"(s) "Обычный"(s) "Normálne"(s) "menengah"(s) "прямій"(s) "navadno"(s) "vidējs"(s) "normalusis"(s) "thường"(s) "Arrunta"(s)
	stylelang: "en"(s) "bg"(s) "ca"(s) "cs"(s) "de"(s) "el"(s) "fi"(s) "hu"(s) "it"(s) "nl"(s) "pl"(s) "ru"(s) "sk"(s) "id"(s) "uk"(s) "sl"(s) "lv"(s) "lt"(s) "vi"(s) "eu"(s)
	fullname: "Free Monospaced"(s)
	fullnamelang: "en"(s)
	slant: 0(i)(s)
	weight: 80(i)(s)
	width: 100(i)(s)
	size: (0, 1.79769e+308)(s)
	pixelsize: 12.5(f)(s)
	spacing: 100(i)(w)
	foundry: "unknown"(w)
	hintstyle: 3(i)(s)
	hinting: True(s)
	verticallayout: False(s)
	autohint: False(s)
	globaladvance: True(s)
	file: "/usr/share/fonts/FreeFont/FreeMono.ttf"(w)
	index: 0(i)(w)
	outline: True(w)
	scalable: True(w)
	dpi: 75(f)(s)
	scale: 1(f)(s)
	charset: 
	0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
	0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	0002: ffffffff 008ffff1 ffff0000 ffffffff ffffffff ffffffff ffffffff ffffffff
	0003: ffffffff ffffffff 07ff3bff 44300000 ffffd7f0 fffffffb 1c7f7fff 00330000
	0004: ffffffff ffffffff ffffffff 30f73ddf fffffcf8 ffffffff ffffffff 03ffffff
	0005: fc0f0000 fffe0000 fe7fffff fffffffe 000006ff fbff0000 ffff001f 001f07ff
	0010: 00000000 00000000 00000000 00000000 00000000 00000000 ffff0000 1a3fffff
	0013: 00000000 00000000 00000000 00000000 00000000 ffffffff ffffffff 001fffff
	0016: 00000000 00000000 00000000 00000000 00000000 ffffffff ffffffff 0001ffff
	001e: ffffffff ffffffff ffffffff ffffffff 0fffffff ffffffff ffffffff 03ffffff
	001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
	0020: ffffffff fffffcff ffffffff fff3001f 001f7fff 003f7ffe f8c70000 0000fd6f
	0021: 77ffe3ff 0fe44ed7 fff8681e ffffffff ffff0000 ffffffff 203fffff 000803c0
	0022: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 0003ffff
	0023: f335ff7d ffc01eff ffffffff f7ffffff ffffffff fcffffff cc00ffff 0000007c
	0024: ffffffff 0000001b 000007ff 000003ff 00000000 00000000 00000000 00000000
	0025: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	0026: fc0703ef feffc340 000fffff 0000feff 0000003f 00000000 00000000 00000000
	0027: 00000000 00000000 00000000 00000000 00000000 00000000 00ff17ff 1fec0ff0
	0028: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
	002a: 2000007f 80000000 00000000 00000000 00000000 00000000 00000000 00000000
	002b: fbfc3fff 00000fff 00180000 00000000 00000000 00000000 00000000 00000000
	002e: 00800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
	00a7: 00000000 00000000 00000000 00000000 00001f00 00000000 00000000 00000000
	00a9: ffffffff 0000ffff 00000000 00000000 00000000 00000000 00000000 00000000
	00fb: e000003f 5f7fffff 0000ffdb 00000000 00000000 00000000 00000000 00000000
	00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 20000000
(w)
	lang: aa|ab|af|ast|av|ay|az-az|ba|bm|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|chr|co|cs|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|ff|fur|fy|ga|gd|gl|gn|gv|ha|haw|he|ho|hr|hu|hy|ia|ig|id|ie|ik|io|is|it|ka|kaa|ki|kk|kl|ku-am|kum|kv|kw|ky|la|lb|lez|ln|lt|lv|mg|mh|mi|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|sco|se|sel|sh|shs|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|to|tr|ts|tt|tw|tyv|uk|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu|ak|an|ber-dz|crh|csb|ee|fat|fil|hsb|ht|hz|jv|kab|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|qu|quz|rn|rw|sc|sg|sn|su|ty|za(s)
	fontversion: 79626(i)(s)
	capability: "otlayout:grek otlayout:hebr otlayout:latn"(w)
	fontformat: "TrueType"(w)
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^⁻------- this information is missing in SPARC
	embeddedbitmap: True(s)
	decorative: False(s)
	namelang: "en"(s)
	prgname: "fc-match"(s)
	postscriptname: "FreeMono"(w)
	color: False(w)

Pattern has 35 elts (size 48)
	...
Comment 1 Akira TAGOH 2016-01-27 02:21:26 UTC
Please check if you have HAVE_FT_GET_X11_FONT_FORMAT in config.h. aside from that, apparently charset is also wrong. maybe good to add a line "#define CHECK 1" in src/fcfreetype.c and build. you can see some clue for that wrong charset.
Comment 2 Matthias Apitz 2016-01-27 09:21:08 UTC
I activated HAVE_FT_GET_X11_FONT_FORMAT in config.h (which was not there) and now the fontformat is recognized as "TrueType" and the filter of CUPS "texttopdf" is happy.

The other change (#define CHECK 1 in src/fcfreetype.c) produces tons of error messages of the type 

x0000007f FT says 0 FC says 1
x00000080 FT says 0 FC says 1
x00000081 FT says 0 FC says 1
...

and

Bitmap extra char ....

while running fc-cache during 'gmake install'
Comment 3 Akira TAGOH 2016-01-27 10:43:27 UTC
(In reply to Matthias Apitz from comment #2)
> I activated HAVE_FT_GET_X11_FONT_FORMAT in config.h (which was not there)

Hmm, well, it isn't something adds by the hand. check config.log. you'll see why it wasn't added there.

> and now the fontformat is recognized as "TrueType" and the filter of CUPS
> "texttopdf" is happy.
> 
> The other change (#define CHECK 1 in src/fcfreetype.c) produces tons of
> error messages of the type 
> 
> x0000007f FT says 0 FC says 1
> x00000080 FT says 0 FC says 1
> x00000081 FT says 0 FC says 1
> ...
> 
> and
> 
> Bitmap extra char ....
> 
> while running fc-cache during 'gmake install'

well, it shouldn't be different. apparently some logic to store the charset in fontconfig seems not work on sparc. dunno why. need to investigate more.
though I don't have sparc machine here.
Comment 4 Matthias Apitz 2016-01-27 16:05:34 UTC
after setting correct values for some PKG_* environment values, pointing to the correct locations, in my case:

PKG_CONFIG_PATH=/usr/local/sisis-pap/lib/pkgconfig export PKG_CONFIG_PATH
PKG_CONFIG=/usr/local/bin/pkgconf export PKG_CONFIG

the ./configure run detects the required functions correctly;

the main problem on this SPARC Solaris 10 server is, that a lot of outdated OpenSource components are installed in other places (like for example /usr/swf/...) and get in the way if one wants to compile clean a new suite; that's why the above target dirs are chosen;


I think we can close this issue;

If you need to test something on SPARC, here I am.
Comment 5 Akira TAGOH 2016-01-28 02:03:24 UTC
(In reply to Matthias Apitz from comment #4)
> after setting correct values for some PKG_* environment values, pointing to
> the correct locations, in my case:
> 
> PKG_CONFIG_PATH=/usr/local/sisis-pap/lib/pkgconfig export PKG_CONFIG_PATH
> PKG_CONFIG=/usr/local/bin/pkgconf export PKG_CONFIG
> 
> the ./configure run detects the required functions correctly;
> 
> the main problem on this SPARC Solaris 10 server is, that a lot of outdated
> OpenSource components are installed in other places (like for example
> /usr/swf/...) and get in the way if one wants to compile clean a new suite;
> that's why the above target dirs are chosen;
> 
> 
> I think we can close this issue;
> 
> If you need to test something on SPARC, here I am.

So charset is same to linux's now right?
Comment 6 Matthias Apitz 2016-01-28 06:20:59 UTC
Created attachment 121343 [details]
output of fc-match on SPARC

I am not an expert of fonts. I'm attaching the output of 

/usr/local/sisis-pap/cups2/bin/fc-match -s -v FreeMono

on Solaris 10 SPARC.
Comment 7 Akira TAGOH 2016-01-28 06:36:03 UTC
obviously it looks difference to what you initially reported. so should be fine. will close this then. thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.