Commit Graph

22 Commits

Author SHA1 Message Date
Behdad Esfahbod 5bbdffd2c2 Add separate match compare function for size
Has two distinctions from FcCompareRange():
1. As best value, it returns query pattern size, even if it's out of font range,
2. Implements semi-closed interval, as that's what OS/2 v5 table defines
2017-09-20 13:13:35 -07:00
Behdad Esfahbod d3a7c3ce69 [varfonts] Change FC_WEIGHT and FC_WIDTH into ranges 2017-09-20 13:13:35 -07:00
Behdad Esfahbod 819d3a5541 [varfonts] Add FC_VARIABLE
For now, we mark all fonts as non-variable.
2017-09-20 13:13:35 -07:00
Behdad Esfahbod 80e155c1c0 [varfonts] Add FC_FONT_VARIATIONS
This is for clients to passthru font variation settings.  Modeled
similar to FC_FONT_FEATURES.  Each element value is for one axis
settings, eg. "abcd=2.3" where 'abcd' is the OpenType Font Variations
axis tag.

Needs docs update.
2017-09-20 13:13:35 -07:00
Behdad Esfahbod e7a0a0a999 Rename FcCompareSizeRange() to FcCompareRange() 2017-09-20 13:13:35 -07:00
Behdad Esfahbod 7519c567e1 Remove FcCompareSize()
Use FcCompareNumber().  The FcCompareSize() returns 0 ("perfect match")
if v2 is zero.  I cannot think of a use-case for this.  The code has been
there from initial commit in 2002.  I suppose back then Keith had a use
for size=0 to mean scalable or something.  Anyway, remove and see.
2017-09-20 13:13:35 -07:00
Khem Raj 1ab5258f7c Avoid conflicts with integer width macros from TS 18661-1:2014
glibc 2.25+ has now defined these macros in <limits.h>
https://sourceware.org/git/?p=glibc.git;a=commit;h=5b17fd0da62bf923cb61d1bb7b08cf2e1f1f9c1a

Create an alias for FC_CHAR_WIDTH for ABI compatibility

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-12-20 16:33:07 +09:00
Behdad Esfahbod bcfe167e3d Add su[pport for symbol fonts
Adds FC_SYMBOL.

This affects fonts having a cmap with platform 3 encoding 0.
We now map their glyphs from the PUA area to the Latin1 area.

See thread "Webdings and other MS symbol fonts don't display"
on the mailing list.

Test before/after with:
$ pango-view --markup --text='<span fallback="false">&#xd7;&#xf0d7;</span>' --font=Wingdings
2015-05-18 15:26:03 -07:00
Behdad Esfahbod dbc7c4a2cf Add FC_COLOR
Only adds "color" to pattern if FreeType version supports color.

Based on patch from Jungshik Shin.
2014-12-14 13:40:02 -08:00
Behdad Esfahbod da8233b0f2 Fixup previous commit 2014-07-06 18:26:03 -04:00
Behdad Esfahbod 75abdaf5c8 Deprecate FC_HASH and don't compute it
It was added without proper measurement and a fuzzy possible
use-case (font servers) in mind, but reality check shows that
this significantly slows down caching.  As such, deprecate it
and do NOT compute hash during caching.

Makes caching two to three times faster (ignoring the 2 second
delay in fc-cache).
2014-06-12 17:02:10 -04:00
Akira TAGOH 3cd573fc1f Bug 71287 - size specific design selection support in OS/2 table version 5
This feature requires the FreeType 2.5.1 or later at the build time.

Besides <range> element allows <double> elements with this changes.

This may breaks the cache but not bumping in this change sets at this moment.
please be aware if you want to try it and run fc-cache before/after to
avoid the weird thing against it.
2014-03-26 12:19:04 +09:00
Akira TAGOH 5918d5bea5 Add missing license headers
https://bugs.freedesktop.org/show_bug.cgi?id=73401
2014-01-17 13:05:25 +09:00
Akira TAGOH 084cf7c44e Bug 16818 - fontformat in match pattern is not respected? 2013-08-14 12:51:26 +09:00
Akira TAGOH 45221ab12f Bug 67845 - Match on FC_SCALABLE 2013-08-07 12:19:33 +09:00
Akira TAGOH 1cad82cde2 Bug 63922 - FcFreeTypeQueryFace fails on postscripts fonts loaded from memory
Workaround to not failing even when the hash is unable to generate from fonts.
This change also contains to ignore the case if the hash isn't in either both
patterns.
2013-05-16 16:49:14 +09:00
Akira TAGOH b561ff2016 Bug 38737 - Wishlist: support FC_POSTSCRIPT_NAME
Add the PostScript name into the cache and the matcher.
Scoring the better font against the PostScript name by
the forward-matching.
2013-03-21 16:34:42 +09:00
Akira TAGOH 4eab908c86 Update _FcMatchers definition logic
to make it easier to maintain. also added FC_HASH_OBJECT to be matched
in the pattern, prior to FC_FILE_OBJECT.
2013-02-06 19:02:07 +09:00
Akira TAGOH 95af7447db Bug 50733 - Add font-file hash?
Add "hash" object which contains SHA256 hash value (so far) computed from the font file.
2013-02-05 15:34:56 +09:00
Behdad Esfahbod ec5ca08c80 Bug 59379 - FC_PRGNAME
Can be used for per-application configuration.
2013-01-15 20:46:45 -06:00
Akira TAGOH 3f84695104 Bug 50497 - RFE: Add OpenType feature tags support
Add FC_FONT_FEATURES to store the feature tags to be enabled.
2013-01-15 19:40:26 -06:00
Behdad Esfahbod d58c31e6dc Use a static perfect hash table for object-name lookup
The hash table is generated by gperf.  For runtime element types, we use
a append-only linked list.

A bit clumsy, but I think I got it right.
2013-01-02 00:35:39 -06:00