Commit Graph

150 Commits

Author SHA1 Message Date
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 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 58acd993cb Allow passing NULL for file to FcFreeTypeQueryFace() 2014-05-16 15:08:52 -06:00
Behdad Esfahbod 3f992254f2 Rewrite hashing to use FT_Stream directly
This is more robust but introduces a small change in behavior:
For .pcf.gz fonts, the new code calculates the hash of the uncompressed
font data whereas the original code was calculating the hash of the
compressed data.

No big deal IMO.
2014-05-16 15:02:58 -06:00
Behdad Esfahbod 748e77e89f Simplify hash code 2014-05-16 14:10:06 -06:00
Akira TAGOH fff91eee7d Fix a build issue with freetype <2.5.1 2014-03-26 12:22:02 +09: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 80081555fd Fix a crash issue when empty strings are set to the BDF properties 2014-01-31 11:10:02 +09:00
Akira TAGOH a61e145304 Fix memory leaks in FcFreeTypeQueryFace 2013-09-09 19:59:31 +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 03216ccf4c Bug 63329 - make check fails: .. contents:: :depth: 2
Add back FcHashGetSHA256DigestFromFile() and fall back to it
when font isn't SFNT-based font because FT_Load_Sfnt_Table
fails with FT_Err_Invalid_Face_Handle.
2013-04-10 18:41:22 +09:00
Akira TAGOH fc5a589aba Revert the previous change and rework to not export freetype API outside fcfreetype.c 2013-04-09 17:18:43 +09:00
Akira TAGOH c93a8b8b54 Obtain fonts data via FT_Face instead of opening a file directly 2013-04-09 12:46:30 +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
Behdad Esfahbod 83f679ce55 Accept digits as part of OpenType script tags
They've been used since 2005.
2013-02-15 09:48:56 -05:00
Akira TAGOH 72b0480a21 Add Culmus foundry to the vendor list
Maps fonts produced by the Culmus project <http://culmus.sourceforge.net>
to the XLFD foundry name culmus.

For TrueType fonts, maps the vendor code CLM from the TrueType vendor id field.

For Type1 fonts, which use heuristics to guess mappings to XLFD foundries from
words in the copyright notice, add the names of the main contributors to
the Culmus product to recognize the fonts under their copyright.

Patch from Maxim Iorsh
2013-02-07 17:56:36 +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 106c4f7311 Minor 2013-01-16 07:05:07 -06:00
Behdad Esfahbod dd69d96e06 Fix sign-compare warnings 2012-12-29 22:47:49 -05:00
Behdad Esfahbod 24cdcf52ab Fix compiler warnings 2012-12-29 22:24:24 -05:00
Akira TAGOH cf70eaa3bf Bug 50525 - superfluous whitespace in the style 2012-06-08 19:41:59 +09:00
Akira TAGOH 1f01c4b60c Bug 23336 - unable to display bitmap-only (SFNT) TrueType or OpenType
Force to find out a size for bitmap-only ttf to avoid the blank glyphs
in the font.

Patch from Bug Fly
2012-03-07 17:32:14 +09:00
Mike Frysinger e3a66c2937 delete unused variables
Newer gcc is better at detecting set-but-unused variables.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-21 14:15:58 -05:00
Akira TAGOH cbb6ee1662 Bug 35517 - Remove Apple Roman cmap support
Get rid of the apple roman encoding related code
2012-02-21 15:16:14 +09:00
Behdad Esfahbod 5aaf466d38 Cleanup copyright notices to replace "Keith Packard" with "the author(s)" 2010-11-10 16:45:42 -05:00
Behdad Esfahbod 594dcef0f3 Remove all training whitespaces 2010-04-12 12:19:05 -04:00
Behdad Esfahbod 632612b810 Accept TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS from name table
The OT spec says:

"When building a Unicode font for Windows, the platform ID should be 3 and the
encoding ID should be 1. When building a symbol font for Windows, the platform
ID should be 3 and the encoding ID should be 0."

We were ignoring the SYMBOL_CS entry before.  It's UTF-16/UCS-2 like the
UNICODE_CS.

Also, always use UTF-16BE instead of UCS-2BE.  The conversion was doing
UTF-16BE anyway.
2010-04-07 12:49:30 -04:00
Behdad Esfahbod 192927225c [fc-glyphname] Rename internal arrays to prefix with _fc_
Although they were static, I was still surprised that gdb was seeing
our variable "glyphs".  Not helpful.
2009-11-18 09:26:24 -05:00
Behdad Esfahbod 6b1fc678ca [int] Define MIN/MAX/ABS macros 2009-11-16 17:28:50 -05:00
Behdad Esfahbod 7575c66661 TT_MS_ID_UCS_4 is really UTF-16BE, not UTF-32
Reported by Yuriy Kaminskiy.
2009-07-25 16:38:52 -04:00
Behdad Esfahbod 55e202a62d Remove unused ftglue code 2009-06-28 14:14:46 -04:00
Behdad Esfahbod 8ea654b2aa Use/prefer WWS family/style (name table id 21/22) 2009-06-24 13:52:11 -04:00
Behdad Esfahbod 3074a73b41 Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files 2009-03-13 17:59:28 -04:00
Behdad Esfahbod 574805478c [fcfreetype] Fix typo in GB2312 encoding name string (#19845)
This was causing failure when opening iconv converter, hence rendering
GB2312-encoded fonts with no other usable encoding unusable.
2009-02-15 13:40:18 -08:00
Behdad Esfahbod b6cf885a0a Don't use identifier named complex 2009-02-13 16:54:03 -08:00
Behdad Esfahbod 00c0972aca Fix compile with old FreeType that doesn't have FT_Select_Size() (bug #17498) 2009-02-13 16:54:02 -08:00
Behdad Esfahbod 317b849215 Replace RCS Id tags with the file name 2009-02-13 16:53:55 -08:00
Keith Packard 3a3f687b75 Add extended, caps, dunhill style mappings.
extended -> expanded.
caps, dunhill -> decorative
2008-05-04 01:27:42 -07:00
Keith Packard 73e8ae3ac8 Remove size and dpi values from bitmap fonts. Bug 8765.
The only relevant information is the pixel size; don't report anything else.
2008-05-03 17:43:39 -07:00
Keith Packard 60421f5d68 Work around for bitmap-only TrueType fonts that are missing the glyf table.
Bitmap-only TrueType fonts without a glyf table will not load a glyph when
FT_LOAD_NO_SCALE is set. Work around this by identifying TrueType fonts that have no
glyphs and select a single strike to measure the glyph map with.
2008-05-03 17:20:34 -07:00
Keith Packard a0a1da22a4 Include fcftaliastail.h so that the freetype funcs are exported.
This header file needs to be included at the end of every file that
exports any freetype symbols.
2008-01-07 16:31:06 -08:00
Keith Packard dbd065ad31 Remove freetype requirement for build-time applications.
This avoids requiring the freetype development files when cross compiling
2008-01-02 08:47:14 -08:00
Keith Packard 4ee9ca6786 Match 'ultra' on word boundaries to detect ultra bold fonts. (bug 2511)
Added FcStrContainsWord to detect strings on word boundaries.
2007-10-25 14:00:15 -07:00
Keith Packard 79641a3b0c Handle UltraBlack weight.
UltraBlack is weight 950 on the CSS scale; handle this by name and value
encoding it as fontconfig weight 215.
2007-10-25 01:03:40 -07:00
Keith Packard d02f6a70f1 Oops. Left debugging printf in previous commit. 2007-10-25 01:02:58 -07:00
Tilman Sauerbeck 28baf72736 Store FcVendorFoundries in read-only memory.
Create fixed size strings for vendor and foundry.
2007-10-25 00:38:44 -07:00