Commit Graph

150 Commits

Author SHA1 Message Date
Tilman Sauerbeck 481f6c2307 Store FcNoticeFoundries in read-only memory.
Use a single character array and a separate table of integer indices.
2007-10-25 00:36:37 -07:00
Keith Packard 1bd0b5ba73 Eliminate relocations from FcCodePageRange structure (bug 10982).
FcCodePageRange was using char pointers; replace them with char arrays.
2007-10-18 09:48:31 -07:00
Keith Packard 96925b99c0 Eliminate relocations for glyph name table.
Glyph names (now used only for dingbats) were using many relocations,
causing startup latency plus per-process memory usage. Replace pointers with
table indices, shrinking table size and elimninating relocations.
2007-10-18 09:43:22 -07:00
Keith Packard f7da903d37 Make FC_FULLNAME include all fullname entries, elide nothing. [bug 12827]
The old policy of eliding fullname entries which matched FC_FAMILY or
FC_FAMILY + FC_STYLE meant that applications could not know what the
font foundry set as the fullname of the font. Hiding information is not
helpful.
2007-10-18 04:31:33 -07:00
Keith Packard c80a08d6bf Work around FreeType bug when glyph name buffer is too small.
Recent versions of FreeType do not correctly deal with glyph name buffers
that are too small; work around this by declaring a buffer that can hold any
PS name (127 bytes).
2007-03-12 10:32:23 -07:00
Keith Packard 72ffe6536a Add FcFreeTypeQueryFace external API. Bug #7311.
Expose ability to build an FcPattern directly from an FT_Face
object.
2006-12-02 13:22:27 -08:00
Keith Packard 253ec7609c Use explicit platform/nameid order when scanning ttf files.
Instead of accepting whatever order names appear in the font file,
use an explicit ordering for both platform and nameid.

Platforms are high precedence than nameids.

The platform order is:

	microsoft, apple unicode, macintosh, (other)

The family nameid order is:

	preferred family, font family

The fullname nameid order is:

	mac full name, full name

The style nameid order is

	preferred subfamily, font subfamily

This will change the names visible to users in various application UIs, but
should not change how existing font names are matched as all names remain
present in the resulting database. The hope is that family names will, in
general, be less ambiguous. Testing here shows that commercial fonts
have longer names now while DejaVu has a shorter family name, and moves more
of the font description to the style name.
2006-12-02 11:47:07 -08:00
David Turner 31e0f03210 Replace character discovery loop with simpler, faster version.
The existing loop for discovering which characters map to glyphs is ugly and
inefficient. The replacement is functionally identical, but far cleaner and
faster.
2006-09-07 14:29:35 -07:00
Keith Packard 23816bf9ac Eliminate .so PLT entries for local symbols. (thanks to Arjan van de Ven)
Using a simple shell script that processes the public headers, two header
files are constructed that map public symbols to hidden internal aliases
avoiding the assocated PLT entry for referring to a public symbol.

A few mistakes in the FcPrivate/FcPublic annotations were also discovered
through this process
2006-09-05 02:24:01 -07:00
Keith Packard c2c6976d1a Add FcMatchScan to resolve Delicious font matching issues (bug #6769)
The Delicious family includes one named Delicious Heavy, a bold variant
which is unfortunately marked as having normal weight. Because the family
name is 'Delicious', fontconfig accidentally selects this font instead of
the normal weight variant. The fix here rewrites the scanned data by running
the scanned pattern through a new substitution sequence tagged with
<match target=scan>; a sample for the Delicious family is included to
demonstrate how it works (and fix Delicious at the same time).

Also added was a new match predicate -- the 'decorative' predicate which is
automatically detected in fonts by searching style names for key decorative
phrases like SmallCaps, Shadow, Embosed and Antiqua. Suggestions for
additional decorative key words are welcome. This should have little effect
on font matching except when two fonts share the same characteristics except
for this value.
2006-09-02 17:52:12 -07:00
Keith Packard 7295c6f5fa Guess that mac roman names with lots of high bits are actually SJIS.
Many Japanese fonts incorrectly include names tagged as Roman encoding and
English language which are actually Japanese names in the SJIS encoding.
Guess that names with a large number of high bits set are SJIS encoded
Japanese names rather than English names.
2006-09-01 21:30:54 -07:00
Keith Packard 5b8e43a48e Avoid #warning directives on non-GCC compilers. (bug 7683)
Detect GCC and use #warning only on GCC systems.
2006-09-01 12:36:31 -07:00
Keith Packard c1c3ba06d5 Make path names in cache files absolute (NB, cache format change) Stop
permitting cache files to be stored in font dirs. Bump cache magic.
    Don't include /fonts.cache-2 in cache hash construction.
reviewed by: Patrick Lam <plam@mit.edu>
2006-04-27 07:11:44 +00:00
Patrick Lam 73775d8f28 Fix the issues with GNU libiconv vs. libc iconv (which especially appear on
Solarii). Approach suggested by Tim Mooney.
reviewed by: plam
2006-04-25 15:33:07 +00:00
Patrick Lam f045376c08 Include $(top_srcdir), $(top_srcdir)/src before anything else.
Shuffle order of includes for building out of srcdir on win32.
reviewed by: plam
2006-04-25 05:57:41 +00:00
Patrick Lam 2f02e38361 Fix memory leak (Coverity defect #2089).
Ignore script if subtable is missing (Coverity defect #2088).
Fix possible null pointer dereference (Coverity defect #784) and memory
    leak (Coverity defects #785, #786).
Don't copy FcCharSet if we're going to throw it away anyway. (Reported by
    Kenichi Handa).
reviewed by: plam
2006-04-12 14:36:36 +00:00
Patrick Lam 04f7d3e7fd Properly convert static charsets to dynamic charsets.
Fix memory leak in error case (Coverity defects #1820, #1821, #1822).
Fix memory leak (Coverity defect #1819).
prevent crash when invalid include line is parsed (Coverity defect #763).
Fix potential null pointer access (Coverity defect #1804).
Remove dead code (Coverity defect #1194).
Prevent potential null pointer access (Coverity defect #767), ensure error
    value is read (Coverity defect #1195).
reviewed by: plam
2006-04-11 14:20:59 +00:00
Patrick Lam d6217cc6bc Patrick Lam <plam@mit.edu>
Make fontconfig compile under MinGW:
1) remove unneeded #includes;
2) make use of mmap and sysconf conditional;
3) replace rand_r by srand/rand if needed;
4) use chsize instead of ftruncate; and
5) update libtool exports file
2006-04-07 04:42:32 +00:00
Patrick Lam 0d745819a9 Fix intel compiler warnings: make many variables static, eliminate
duplicate names, reduce variable scopes, unsigned/signed printf
    formatting.
reviewed by: plam
2006-04-06 04:33:11 +00:00
Patrick Lam d8951c0cc2 Remove stuff we don't use, make get_{char,short,long} functions of ftglue
macros to be inlined.
Code cleanups (excess prototype, old-style function definition).
reviewed by: plam
2006-03-08 02:30:43 +00:00
Patrick Lam bb6b19938e Get rid of C++-style comments. 2006-03-03 06:35:53 +00:00
Patrick Lam 0cfaf27e33 Takashi Iwai <tiwai@suse.de> reviewed by: plam
Fix double-free on error case.
2006-02-24 16:41:34 +00:00
Patrick Lam 656b47f698 Pass the buck; make fontconfig not crash on pango badness. 2006-02-21 15:56:41 +00:00
Patrick Lam f2fb985c7a Eliminate redundancies.
reviewed by: plam
2006-02-21 15:50:19 +00:00
Patrick Lam b023dbd384 Eliminate unused vars reported by Intel's compiler.
reviewed by: plam
2006-02-21 15:40:18 +00:00
Patrick Lam f8a17f3298 Fix memory leak in error condition code. 2006-02-13 22:19:30 +00:00
Patrick Lam 5657098e29 Skip bitmap fonts which can't even get it together enough to declare a
family name; this appears to reproduce previous fontconfig behaviour.
reviewed by: plam
2006-02-13 21:51:11 +00:00
Patrick Lam 16a71eff3e Treat zh-hk fonts differently from zh-tw fonts. This patch may cause
fontconfig to treat A-X fonts differently from A-Y fonts; please mail
    the fontconfig list if this causes any problems.
reviewed by: plam
2006-01-25 02:54:37 +00:00
Patrick Lam 6f9fcb5186 Fix memory leaks reported by Ronny V. Vindenes. 2006-01-25 02:33:46 +00:00
Patrick Lam 6f767cec49 Restore code to skip over PCF fonts that have no encoded characters. (We
guess that a font is PCF by presence of the PIXEL_SIZE BDF property.)
2005-12-20 20:35:47 +00:00
Patrick Lam 8ebf7725a8 Get rid of the use of freetype internal headers in fcfreetype.c, since
those headers will go away with freetype 2.2. Replace with public
    domain ftglue code from pango. Note that the patch removes some extra
    error checking in FT_Get_BDF_Property() and comments out the skipping
    of empty pcf fonts.
reviewed by: plam
2005-11-19 22:32:13 +00:00
Patrick Lam 7358dae49b Fix warnings and embarrassing double-free error. 2005-11-03 04:23:22 +00:00
Patrick Lam d6946c1a11 Fix small memory error (tried to free argv); use basename and dirname
correctly (they can modify their arguments).
2005-11-01 05:52:28 +00:00
Patrick Lam e77c17184a Reinstate basename patch, but keep a hash table linking FcPatterns to their
fully-qualified font names for clients' benefit. Clients only pay for
    the font names once they request the FC_FILE property from an
    FcPattern, but the font name is malloc'd at that point (i.e. not
    mmapped: that's impossible, since it may vary between machines.)
    Clients do have to pay for a copy of the path name per cache file.
Note that FcPatternGetString now does some rewriting if you ask for an
    FC_FILE, appending the pathname as appropriate.
2005-11-01 05:26:27 +00:00
Patrick Lam be99726f67 Revert basename patch, which breaks fontconfig clients on my system. 2005-10-31 06:02:00 +00:00
Patrick Lam 961d9b9993 Only add basename to patterns' FC_FILE element, not any part of the
dirname.
2005-10-25 22:29:13 +00:00
Patrick Lam 573da72910 Add some more consts, fixing more GCC4 warnings. 2005-10-22 15:12:05 +00:00
Patrick Lam bef069e19e Convert fromcode to char[12] from char *. 2005-09-23 02:08:40 +00:00
Patrick Lam 67accef4d3 Fix more gcc4 warnings:
- Cast sizeof to int, to shut up signedness warnings in comparison.
- Add consts where appropriate.
reviewed by: Patrick Lam <plam@mit.edu>
2005-09-22 23:45:53 +00:00
Patrick Lam 8245771d5a Merge with HEAD and finish the GCC 4 cleanups (no more warnings!) 2005-09-11 02:16:09 +00:00
Keith Packard 716ac8b803 Don't force bitmap font enable in default configuration; allows users to
override this in ~/.fonts.conf
Updated translations
Destroy font configuration on exit to help valgrind
Use own transcoding routines in preference to iconv which appears to have
    leaks in some translators. Call iconv_close after using iconv (oops).
Prefer unicode encoding of Euro char as some fonts mis-encode Euro in other
    ones.
Must fetch bitmap glyphs to get width values to check for
    monospace/dual-width fonts.
2005-04-21 19:03:53 +00:00
Keith Packard 76a8dfa337 Include space and remove numbers from valid script tags. This ensures that
tags like 'lao ' work while rejecting those which have any digits.
    Eliminate a spurious debugging variable (len)
2005-03-05 23:50:55 +00:00
Keith Packard 219f7818da Rework GSUB/GPOS script parsing to survive broken fonts. Thanks for the
broken font go to Manish Singh
2005-03-05 23:34:57 +00:00
Keith Packard 97bde49a2b Josselin Mouette:
Include 2.3 release information in changelog Add Josselin Mouette as an
    Uploader Set hinting_type to low priority configuration option
Manish Singh:
yes_bitmaps.conf -> yes-bitmaps.conf
Funda Wang:
Johap -> Johab
2005-03-05 20:58:39 +00:00
Keith Packard 0c009d2b6d Generate and install PDF versions of the manuals
Fix formatting
Add missing exported functions, fix data types
Add missing pattern elements.
Add missing pattern elements. Document conf.d usage, clarify available
    orthography list. Fix some config file attributes. Complete list of
    constants.
Mark FC_SOURCE deprecated.
Don't set FC_SOURCE any longer.
2005-03-01 20:36:48 +00:00
Keith Packard 46b51147d1 Change files from ISO-Latin-1 to UTF-8 2004-12-07 01:14:46 +00:00
Keith Packard e4125ef950 Check for non-empty face->family_name and face->style_name before using
those for the font. Empty names match everything. Bug #171.
2004-12-05 04:11:11 +00:00
Keith Packard 537e3d23fa Create FC_FONTFORMAT from FT_Get_X11_Font_Format function where available.
This provides font file format information (BDF, Type 1, PCF, TrueType)
    for each font. Closes #109.
2004-12-05 00:26:06 +00:00
Keith Packard dbf68dd5fe Fix typo.
Add detection for font capabilities (bug #105)
reviewed by: Keith Packard <keithp@keithp.com>
2004-12-04 22:06:52 +00:00
Keith Packard 4f27c1c0a3 Move existing fonts.conf to fonts.conf.bak
Add detection of iconv
Document new selectfont elements
Switch to UTF-8 in comment
Add fullname, and family/style/fullname language entries
Respect selectfont/*/glob
Add support for selectfont
Add multi-lingual family/style/fullname support
Expose FcListPatternMatchAny (which selectfont/*/pattern uses)
Add new FcPatternRemove/FcPatternAppend. FcObjectStaticName stores computed
    pattern element names which are required to be static.
2004-12-04 19:41:10 +00:00
Keith Packard ec0c740e39 Add FcResultOutOfMemory to provide an accurate error when FcFontSetMatch
fails in this way
Make #warning about lacking various FreeType features indicate which
    version those features appeared so users know how to fix the problem
    (Thanks to Anton Tropashko)
2004-05-29 19:32:41 +00:00
Keith Packard 55a69bd0ae Replace MIN/MAX/ABS macros which happen to have come from FreeType with
fontconfig-specific ones (FC_*)
2004-05-06 02:28:37 +00:00
Keith Packard 6ae6acf317 Add instructions for doing a release
clean up .spec file; perhaps this will be useful to somebody...
Update to 2.2.93
Make 'scanopen' static so GCC doesn't whine about lacking prototype
Add WARN_CFLAGS to pass -W flags for GCC systems
Change various char types around to match across function calls. Fixed bug
    in using available_sizes[i].height which is in pixels, not 64ths of a
    pixel.
2004-04-14 18:08:41 +00:00
Keith Packard 89e28590f3 Force FC_FOUNDRY and FC_WIDTH to always be set so that matches looking for
explicit values prefer exact matches
2004-03-06 23:44:11 +00:00
Keith Packard 02638f1ace Supplied by: mfabian@suse.de (Mike FABIAN)
Bug #260 fc-cache generates wrong spacing values for bitmap fonts Was using
    (strcmp (a,b)) instead of (!strcmp(a,b)).
2004-03-02 16:48:51 +00:00
Keith Packard 208a720f00 Ok, so I messed up the test for y_ppem. Let's see if I got it right this
time.
2004-02-11 18:53:05 +00:00
Keith Packard 4f38fa8106 Pre-2.1.5 versions of FreeType didn't include y_ppem in the FT_Bitmap_Size
record. Add a configure.in test for this and change the code
    accordingly (using height instead).
2004-02-10 18:38:58 +00:00
Keith Packard b68b96464f Add Low Saxon orthography (Kenneth Rohde Christiansen <kenneth@gnu.org>)
Oops. Left 'newest.set' unset, which would miscompute the newest file
Add FcGetPixelSize to extract correct pixel size from bdf/pcf font
    properties (which report the wrong value in current FreeType)
Don't attempt to check for empty glyphs in non-scalable fonts; they have no
    outlines...
2004-02-07 07:13:48 +00:00
Keith Packard 408dd9c07a Switch to FreeType 2.1.7 style includes. Bug #150.
reviewed by: Keith Packard <keithp@keithp.com>
2003-11-18 07:53:04 +00:00
Noah Levitt a05d257fb3 Add new spacing value FC_DUAL (dual-width, as some CJK fonts). (bug #111)
When checking for monospace and dual-width fonts, allow roughly a 3%
    variance in the advances.
2003-09-06 19:40:41 +00:00
Keith Packard 656c69d6a8 Add autoconf checks for FT_Has_PS_Glyph_Names 2003-06-26 08:19:11 +00:00
Keith Packard 79621aa5c7 Lean on autoconf to find useful FreeType functions (bug 95) 2003-06-25 23:21:03 +00:00
Keith Packard 53183e66e5 Fix build error with BDF prop local. Free langset after query 2003-05-17 02:17:19 +00:00
Keith Packard f777f1b35d oops. Left the psfontinfo.weight matching code commented out while testing
other stuff...
2003-05-16 16:37:16 +00:00
Juliusz Chroboczek ecb7c180d0 Extract spacing from XLFD atom 2003-05-14 20:23:24 +00:00
Keith Packard 0b7a0da20b Use FcIsWidth to share code
Set FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH when scanning fonts to avoid
    misclassifying some Han fonts as monospaced.
2003-05-12 20:48:59 +00:00
Juliusz Chroboczek 65d1441df8 Reinstate SETWIDTH_NAME parsing for legacy fonts, disappeared in 1.30. 2003-05-12 09:11:10 +00:00
Juliusz Chroboczek 0f362ad520 Generate FC_SIZE and FC_DPI for legacy bitmap fonts 2003-05-12 09:04:24 +00:00
Keith Packard d47c9d6efe Add filename-based accept/reject to ammend available fonts.
change FT_ENCODING_ADOBE_CUSTOM to ft_encoding_adobe_custom for older
    FreeType releases.
2003-05-07 16:13:24 +00:00
Keith Packard 7769c3213d Handle Adobe glyph names for fonts which include ADOBE_CUSTOM encodings 2003-05-04 22:53:49 +00:00
Keith Packard 11fec41c0e Grub through style to find weight/slant/width values when other techniques
fail
2003-05-02 01:11:53 +00:00
Keith Packard 3760a63825 Add demi and book postscript weight names. Allow spaces in postscript and X
matching
2003-05-01 14:31:04 +00:00
Keith Packard 1af9b7b4d9 Typo in bitstream foundry name 2003-04-30 15:17:42 +00:00
Keith Packard 70ee88099e Debug output for unknown ps weight names. ignore italic_angle for PS fonts
as FreeType already checks that
2003-04-24 17:31:03 +00:00
Keith Packard 965f77940c From James Su -- only part of page 0xff is Latin 2003-04-20 04:44:09 +00:00
Keith Packard 29d961a28e Guard calls to FT_Get_BDF_Property to avoid freetype jumping through null
pointer
2003-04-18 15:56:05 +00:00
Keith Packard 2b2f2a714a BDF properties not available until FreeType 2.1.4 2003-04-17 21:29:12 +00:00
Keith Packard 0e7a434783 Search through the BDF properties for width and foundry information 2003-04-16 18:08:47 +00:00
Keith Packard 2e2121f910 Move foundry detection data into fcfreetype.c (which is getting rather
large at this point)
2003-04-16 16:19:38 +00:00
Keith Packard 52253696cd Clean up ps font weight matching and check for NULL 2003-04-15 17:01:39 +00:00
Juliusz Chroboczek 2ae95e77f7 Implemented foundry generation for Type 1 and TrueType 2003-04-11 23:45:59 +00:00
Keith Packard 9f2bcb3e41 Switch to locale-independent string compare function 2003-04-11 22:24:23 +00:00
Keith Packard d6ea834746 Bug #46, #47 fontconfig should retrieve type 1 font information from
FontInfo dictionary Patch provided by g2@magestudios.net (Gerard
    Escalante)
2003-04-11 22:17:11 +00:00
Keith Packard 848d32bd3f Set spacing to mono if every encoded glyph is the same width 2003-03-28 17:08:35 +00:00
Keith Packard 81fa16c336 add font widths and extend weight from OS/2 table 2003-03-12 22:16:43 +00:00
Keith Packard 4bd4418ab5 Change RCS tag 2003-03-05 05:51:27 +00:00
Keith Packard 148656ed8b Stop setting FC_SPACING from font hints. Theyre always wrong 2003-02-27 07:04:59 +00:00
Keith Packard c647f6f1e4 Build fclang.h before building library This required compiling the charset
funcs into fc-lang, which was done by refactoring code in fccharset.c
    and fcfreetype.c a bit
Updated ethiopic orthographies
Remove imake support
Install empty local.conf file if none is present
2003-02-06 17:46:06 +00:00
Keith Packard a342e87dc3 Add fontversion field 2002-09-26 00:17:28 +00:00
Keith Packard 9dac3c5945 More complete memory tracking. Install always overwrites header files 2002-08-31 22:17:32 +00:00
Keith Packard d8d7395877 Reimplement FC_LANG as FcTypeLang, freeze patterns, other cleanup 2002-08-22 07:36:45 +00:00
Keith Packard 69937bd941 Add some Utf16 support, extract font family and style names from name table
for sfnt fonts
2002-07-13 05:43:25 +00:00
Keith Packard 2fcac34973 Trim ideographic punctuation and Suzhou numerals from zh-tw orthography.
Had accidentally swapped codePageRange bits for traditional and
    simplified chinese. Add persian (fa) and HKSCS (zh-hk). Fix possible
    bug in charset walking
2002-07-09 02:28:29 +00:00
Keith Packard e50b9ae711 Update iso639-2 language coverage info, fix Georgian orthography to
eliminate Mingrelian and Svan glyphs, use coverage for inclusion and
    OS/2 for Han exclusion, restructure fclang.c to use fclang.h from
    fc-lang dir
2002-07-08 07:31:53 +00:00
Keith Packard 82f4243f22 Switch to RFC 3066 based lang names 2002-07-06 23:47:44 +00:00
Keith Packard 4c0036053a Add strong/weak pattern value binding, add known charsets for automatic
lang computation
2002-06-29 20:31:02 +00:00
Keith Packard be0948508c Add support for user-provided freetype faces to Xft 2002-05-31 23:21:25 +00:00
Keith Packard bbbaac3691 fontconfig: some config file parsing mistakes 2002-02-22 18:54:07 +00:00
Keith Packard ccb3e93b27 fontconfig library: build fixes and compiler warning fixes 2002-02-15 06:01:28 +00:00
Keith Packard 24330d27f8 Initial revision 2002-02-14 23:34:13 +00:00