Commit Graph

1707 Commits

Author SHA1 Message Date
Behdad Esfahbod 66db69a6d9 Treat color fonts as scalable
All color fonts are designed to be scaled, even if they only have
bitmap strikes.  Client is responsible to scale the bitmaps.  This
is in constrast to non-color strikes...

Clients can still use FC_OUTLINE to distinguish bitmap vs outline
fonts.  Previously FC_OUTLINE and FC_SCALABLE always had the same
value.  Now FC_SCALABLE is set to (FC_OUTLINE || FC_COLOR).

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=87122
2014-12-14 13:57:24 -08: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 fc7e1a9497 Fix buffer overflow in copying PS name
As reported on the mailing list by Tanel Liiv.  Found using American Fuzzy Lop.
2014-12-12 21:42:35 -08:00
Akira TAGOH 32ac7c75e8 Returns False if no fonts found
https://bugs.freedesktop.org/show_bug.cgi?id=86950
2014-12-09 19:06:46 +09:00
Akira TAGOH b732bf057f Update aliases for new URW fonts
Patch from Tom Yan

https://bugs.freedesktop.org/show_bug.cgi?id=85225
2014-11-06 13:15:09 +09:00
Akira TAGOH e7121de237 Revert "Bug 73291 - poppler does not show fl ligature"
This reverts commit c6aa4d4bfc.

This issue has been fixed in poppler and we no longer need to patch it out in fontconfig.
2014-10-03 12:26:42 +09:00
Akira TAGOH 1082161ea3 Add FcRangeGetDouble()
https://bugs.freedesktop.org/show_bug.cgi?id=82876
2014-09-25 17:03:27 +09:00
Behdad Esfahbod 286cdc9c10 Revert "[fcmatch] When matching, reserve score 0 for when elements don't exist"
This reverts commit a5a384c5ff.

I don't remember what I had in mind for "We will use this property later.", but
the change was wrong.  If a font pattern doesn't have any value for element,
it must be interpretted as "it matches any value perfectly.  And "perfectly"
must have a score of 0 for that to happen.

This was actually affecting bitmap fonts (in a bad way), as the change made
an outline font to always be preferred over a (otherwise equal) bitmap font,
even for the exact size of the bitmap font.  That probably was never noticed
by anyone, but with the font range support this has become clear (and worked
around by Akira).  To clean that up, I'm reverting this so I can land the
rest of patches for bug 80873.

https://bugs.freedesktop.org/show_bug.cgi?id=80873#c10
2014-08-20 15:23:04 -04:00
Akira TAGOH f094539687 Note FcConfigSetCurrent() increases the refcount in document 2014-08-13 11:39:29 +09:00
Akira TAGOH eb2689c67b Fix the memory leak in fc-cat 2014-08-12 18:53:04 +09:00
Akira TAGOH 23e88d8c6a Increase the refcount in FcConfigSetCurrent()
https://bugs.freedesktop.org/show_bug.cgi?id=82432
2014-08-12 18:48:00 +09:00
Akira TAGOH 841753a93f fallback to the another method to lock when link() failed
Bug 82358 - FcAtomicLock fails on OS X on network mounts
https://bugs.freedesktop.org/show_bug.cgi?id=82358
2014-08-11 12:14:54 +09:00
Behdad Esfahbod 748a2ce9d4 Fix previous commit
Ouch!
2014-08-06 14:45:02 -04:00
Behdad Esfahbod 3d2627bba6 Trebuchet MS is a sans-serif font, not serif
https://bugs.freedesktop.org/show_bug.cgi?id=82099
2014-08-06 14:28:18 -04:00
Behdad Esfahbod 80edaccc3c If OS/2 table says weight is 1 to 9, multiply by 100
https://bugs.freedesktop.org/show_bug.cgi?id=82228
2014-08-06 12:29:35 -04:00
Behdad Esfahbod 01bb6978b6 Fix assertion failure
https://bugs.freedesktop.org/show_bug.cgi?id=82220
https://bugs.freedesktop.org/show_bug.cgi?id=82228
2014-08-06 12:23:24 -04:00
Behdad Esfahbod 37e501ed0a Remove unneeded FcPublic 2014-07-27 16:53:28 -04:00
Behdad Esfahbod a9e7b0494e Export recently added API
We should remove this alias mess.
2014-07-26 16:17:02 -04:00
Behdad Esfahbod ffda7c0e81 Linearly interpolate weight values
Rest of Part of https://bugs.freedesktop.org/show_bug.cgi?id=81453

Adds new API:

	FcWeightFromOpenType()
	FcWeightToOpenType()
2014-07-25 18:07:59 -04:00
Behdad Esfahbod bf9df5ada7 Change DemiLight from 65 to 55
Such that Regular is closer to Medium than to DemiLight
2014-07-25 18:07:59 -04:00
Behdad Esfahbod be6506ca04 Add FC_WEIGHT_DEMILIGHT
Part of https://bugs.freedesktop.org/show_bug.cgi?id=81453
Also hooks up FC_WEIGHT_BOOK to fcfreetype.c.
2014-07-25 16:24:26 -04:00
Behdad Esfahbod 9839d0112c Improve / cleanup namelang matching
Previously, if the patten didn't request, eg, style, then the style
and stylelang were fully copied from the font, even though the pattern
had a stylelang.  Eg:

$ fc-match 'Apple Color Emoji:stylelang=en'
Apple Color Emoji.ttf: "Apple Color Emoji" "標準體"

This change both fixes that and makes the code much more readable.  Now:

$ fc-match 'Apple Color Emoji:stylelang=en'
Apple Color Emoji.ttf: "Apple Color Emoji" "Regular"
2014-07-24 16:07:13 -04:00
Behdad Esfahbod 874a549164 Remove unused regex code
Regex matching was disabled in f6244d2cf2
2014-07-24 15:42:54 -04:00
Behdad Esfahbod 9a8e812477 Use lang=und instead of lang=xx for "undetermined"
That's the correct BCP 47 code.
2014-07-24 15:37:51 -04:00
Behdad Esfahbod 76151ceaf3 Ouch, fix buffer 2014-07-24 15:34:20 -04:00
Behdad Esfahbod aeba5bf4b6 Decode MacRoman encoding in name table without iconv
iconv support was turned off by default in f30a5d76.
Some fonts, like Apple Color Emoji, only have their English
name in a MacRoman entry.  As such, decode MacRoman ourselves.
2014-07-24 15:28:09 -04:00
Behdad Esfahbod 07a0f511b1 Call FcInitDebug from FcFreeTypeQueryFace 2014-07-24 15:01:57 -04:00
Behdad Esfahbod a5641cfb24 Revert "Symlinks fix for DESTDIR"
This reverts commit fd5667b42c.

This was wrong, as pointed out by Akira on the list.
We want symlinks to final destination.
2014-07-23 13:21:05 -04:00
Behdad Esfahbod fd5667b42c Symlinks fix for DESTDIR
From:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-fontconfig/fontconfig-2.11.0-symlinks-fix.patch
2014-07-23 11:57:47 -04:00
Akira TAGOH 107b44f50b Don't add duplicate lang
Don't add duplicate lang from FC_LANG if the pattern already has.

https://bugs.freedesktop.org/show_bug.cgi?id=81186
2014-07-23 19:17:26 +09:00
Behdad Esfahbod 342b908b96 More mingw32 MemoryBarrier() fixup 2014-07-19 16:33:49 -04:00
Behdad Esfahbod 6781c6baef Update mingw32 MemoryBarrier from HarfBuzz
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=81228
2014-07-11 12:20:24 -04:00
Akira TAGOH dca5d0feee Fix a gcc warning
test-migration.c:17:5: warning: pointer targets in passing argument 1 of 'FcStrDirname' differ in signedness
2014-07-08 14:55:15 +09:00
Behdad Esfahbod da8233b0f2 Fixup previous commit 2014-07-06 18:26:03 -04:00
Behdad Esfahbod bb27d6969c Remove HASH from matching priorities
We deprecated FC_HASH, so doesn't make sense to sort on it.
2014-07-06 18:10:49 -04:00
Behdad Esfahbod 5674b8a663 Comments 2014-07-06 17:42:33 -04:00
Akira TAGOH 5b22776999 Fix a crash when no sysroot is given and failed to load the default fonts.conf 2014-07-04 18:04:52 +09:00
Behdad Esfahbod f5b4b2c1ed Fix charset unparse after recent changes 2014-07-04 01:43:47 -04:00
Behdad Esfahbod 940d27a197 Minor 2014-07-03 21:15:25 -04:00
Behdad Esfahbod e708e97c35 Change charset parse/unparse format to be human readable
Previous format was unusable.  New format is ranges of hex values.
To choose space character and Latin capital letters for example:

$ fc-pattern ':charset=20 41-5a'
Pattern has 1 elts (size 16)
	charset:
	0000: 00000000 00000001 07fffffe 00000000 00000000 00000000 00000000 00000000
(s)
2014-07-03 17:54:11 -04:00
Akira TAGOH dab60e4476 Rework for 5004e8e01f
Don't read/write from/to the XDG dirs even if XDG_*_HOME is set
and the home directory is disabled.
2014-06-30 15:12:32 +09:00
Akira TAGOH 5004e8e01f Don't read/write from/to the XDG dirs if the home directory is disabled 2014-06-30 12:39:31 +09:00
Behdad Esfahbod 274f2181f2 Update blanks to Unicode 7.0 2014-06-18 12:20:57 -04:00
Akira TAGOH 2f96482a9f Update CaseFolding.txt to Unicode 7.0 2014-06-18 19:13:53 +09:00
Akira TAGOH 6c3c2603b9 Fix a segfault
introduced by the previous commit d17f556153
2014-06-18 19:13:06 +09:00
Behdad Esfahbod 8915c15b9e Update list of blanks to Unicode 6.3.0
Some were bogus, some were missing.  See:

  https://bugs.freedesktop.org/show_bug.cgi?id=79956
2014-06-17 11:45:48 -04:00
Akira TAGOH d17f556153 Read the config files and fonts on the sysroot when --sysroot is given to fc-cache
Fix for e96d776088

https://bugs.freedesktop.org/show_bug.cgi?id=59456
2014-06-17 20:11:02 +09:00
Behdad Esfahbod 8f62ccaa96 Remove unused FcHash code now that FC_HASH is deprecated 2014-06-12 17:02:10 -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
Behdad Esfahbod cd9631d83e [ko.orth] Remove U+3164 HANGUL FILLER
Better not to reject a font just over that.  Note that we do NOT
list U+115F and U+1160 either.
2014-06-12 17:02:10 -04:00