Behdad Esfahbod [Tue, 10 Feb 2009 11:22:55 +0000 (06:22 -0500)]
[fcformat] Start adding builtins
Behdad Esfahbod [Tue, 10 Feb 2009 10:57:10 +0000 (05:57 -0500)]
[fcformat] Implement 'delete', 'escape', and 'translate' filter functions
The format '%{family|delete( )}' expands to family values with space removed.
The format '%{family|translate( ,-)}' expands to family values with space
replaced by dash. Multiple chars are supported, like tr(1).
The format '%{family|escape(\\ )}' expands to family values with space
escaped using backslash.
Behdad Esfahbod [Tue, 10 Feb 2009 10:05:53 +0000 (05:05 -0500)]
[fcformat] Add value-count syntax
The format '%{#family}' expands to the number of values for the element
'family', or '0' if no such element exists in the pattern.
Behdad Esfahbod [Tue, 10 Feb 2009 09:47:24 +0000 (04:47 -0500)]
[FcStrBuf] better handle malloc failure
If buffer has failed allocation, return NULL when done.
Behdad Esfahbod [Tue, 10 Feb 2009 09:44:54 +0000 (04:44 -0500)]
[fcformat] Implement 'cescape', 'shescape', and 'xmlescape' converters
Behdad Esfahbod [Tue, 10 Feb 2009 08:38:22 +0000 (03:38 -0500)]
[fcformat] Add simple converters
The format '%{family|downcase}' for example prints the lowercase of
the family element. Three converters are defined right now:
'downcase', 'basename', and 'dirname'.
Behdad Esfahbod [Tue, 10 Feb 2009 05:15:08 +0000 (00:15 -0500)]
[fcformat] Add conditionals
The conditional '%{?elt1,elt2,!elt3{expr1}{expr2}}' will evaluate
expr1 if elt1 and elt2 exist in pattern and elt3 doesn't exist, and
expr2 otherwise. The '{expr2}' part is optional.
Behdad Esfahbod [Tue, 10 Feb 2009 04:08:08 +0000 (23:08 -0500)]
[fcformat] Add element filtering and deletion
The filtering, '%{+elt1,elt2,elt3{subexpr}}' will evaluate subexpr
with a pattern only having the listed elements from the surrounding
pattern.
The deletion, '%{-elt1,elt2,elt3{subexpr}}' will evaluate subexpr
with a the surrounding pattern sans the listed elements.
Behdad Esfahbod [Tue, 10 Feb 2009 01:49:45 +0000 (20:49 -0500)]
[fcformat] Add support for subexpressions
The syntax is '{{expr}}'. Can be used for aligning/justifying an entire
subexpr for example.
Behdad Esfahbod [Tue, 10 Feb 2009 00:13:07 +0000 (19:13 -0500)]
[fcformat] Refactor and restructure code for upcoming changes
Also makes it thread-safe.
Behdad Esfahbod [Mon, 9 Feb 2009 23:18:59 +0000 (18:18 -0500)]
[fcformat] Add support for width modifiers
One can do '%30{family}' for example. Or '%-30{family}' for the
left-aligned version.
Behdad Esfahbod [Fri, 6 Feb 2009 04:37:16 +0000 (23:37 -0500)]
Further update Sinhala orthography (#19288)
Behdad Esfahbod [Thu, 5 Feb 2009 07:46:16 +0000 (02:46 -0500)]
[cache] After writing cache to file, update the internal copy to reflect this
Only do it for small caches though. For large cache we'd better off loading
the cache file again, mmap()ing it.
Based on patch from Diego Santa Cruz.
Behdad Esfahbod [Wed, 4 Feb 2009 20:58:36 +0000 (15:58 -0500)]
Update Sinhala orthography (#19288)
Patch from Harshula Jayasuriya.
Behdad Esfahbod [Wed, 4 Feb 2009 02:06:15 +0000 (21:06 -0500)]
[fccache] Make sure the cache is current when reusing from open caches
Reported by Diego Santa Cruz.
Behdad Esfahbod [Wed, 4 Feb 2009 01:50:29 +0000 (20:50 -0500)]
[win32] Do not remove leading '\\' such that network paths work
Raised by Diego Santa Cruz.
Behdad Esfahbod [Wed, 4 Feb 2009 01:35:10 +0000 (20:35 -0500)]
[win32] Expand "APPSHAREFONTDIR" to ../share/fonts relative to binary location
Proposed by Diego Santa Cruz.
Behdad Esfahbod [Wed, 4 Feb 2009 01:31:30 +0000 (20:31 -0500)]
[win32] Fix usage of GetFullPathName()
Diego Santa Cruz pointed out that we are using that API wrongly.
The forth argument is a pointer to a pointer. Turns out we don't
need that arugment and it accepts NULL, so just pass that.
Behdad Esfahbod [Tue, 3 Feb 2009 22:15:52 +0000 (17:15 -0500)]
Add ICONV_LIBS to fontconfig.pc.in (#19606)
Mike FABIAN [Tue, 3 Feb 2009 21:57:01 +0000 (16:57 -0500)]
[conf] Disable hinting when emboldening (#19904)
Hinting will be done before Embolden in freetype2,
but in such case, Embolden will get wrong result
on some glyph contours after applying hinting.
Actually, hinting should be done after embolden, but we can't
fix it in current freetype2. So as a workaround, just turn off
hinting if we want to do embolden.
Roozbeh Pournader [Mon, 2 Feb 2009 08:27:58 +0000 (00:27 -0800)]
Remove punctuation symbols from Asturian orthography (bug #19893)
Also fix the URL for orthography.
Roozbeh Pournader [Mon, 2 Feb 2009 07:52:10 +0000 (23:52 -0800)]
Rename Igbo from "ibo" to "ig" (bug #19892)
Roozbeh Pournader [Mon, 2 Feb 2009 06:14:53 +0000 (22:14 -0800)]
Renamed az to az_az (bug #19889)
Roozbeh Pournader [Mon, 2 Feb 2009 04:46:23 +0000 (20:46 -0800)]
Add Berber orthographies in Latin and Tifinagh scripts (bug #19881)
Roozbeh Pournader [Mon, 2 Feb 2009 04:42:54 +0000 (20:42 -0800)]
Add Upper Sorbian (hsb) orthography (bug #19870)
Roozbeh Pournader [Mon, 2 Feb 2009 04:41:14 +0000 (20:41 -0800)]
Add Kinyarwanda (rw) orthography (bug #19868)
Roozbeh Pournader [Mon, 2 Feb 2009 04:39:03 +0000 (20:39 -0800)]
Add Malay (ms) orthography (bug #19867)
Roozbeh Pournader [Mon, 2 Feb 2009 04:36:55 +0000 (20:36 -0800)]
Add Kashubian (csb) orth file (bug #19866)
Roozbeh Pournader [Mon, 2 Feb 2009 04:29:12 +0000 (20:29 -0800)]
Rename "ku" to "ku_am", add "ku_iq" (bug #19853).
For Iraq, we are assuming its the same Arabic orthography used in Iran.
According to Ethnologue, Kurdish is written in Cyrillic in Armenia:
http://www.ethnologue.com/show_language.asp?code=kmr
Turkey and Syria need more research.
Roozbeh Pournader [Mon, 2 Feb 2009 04:21:45 +0000 (20:21 -0800)]
Rename Venda from "ven" to "ve" (bug #19852)
Since ISO 639-1 code exists, we should use it.
Roozbeh Pournader [Mon, 2 Feb 2009 04:00:15 +0000 (20:00 -0800)]
Change Turkmen orth from Cyrillic to Latin (bug #19849)
Roozbeh Pournader [Mon, 2 Feb 2009 03:35:37 +0000 (19:35 -0800)]
Fix doubly encoded UTF-8 in comments (bug #19848)
Roozbeh Pournader [Mon, 2 Feb 2009 03:29:21 +0000 (19:29 -0800)]
Split Mongolian orth to Mongolia and China (bug #19847)
The orth file for Mongolia uses Cyrillic, while that of
China uses the classical Mongolian script.
Roozbeh Pournader [Mon, 2 Feb 2009 02:55:31 +0000 (18:55 -0800)]
Add Filipino orth, alias Tagalog to Filipino (bug #19846)
The previous Tagalog orthography used the Tagalog script, which is not in
modern use.
Roozbeh Pournader [Mon, 2 Feb 2009 02:52:41 +0000 (18:52 -0800)]
Remove Sinhala characters not in modern use (bug #19288)
Roozbeh Pournader [Mon, 2 Feb 2009 02:32:21 +0000 (18:32 -0800)]
Correct Sindhi orthography to use Arabic script (bug #17140)
The previous version used the Devanagari script. But in both Pakistan and
India, Sindhi is generally written in Arabic. The Devanagari data could
prove to be useful, if we decide on how we should name such files (see
bug #17208 and bug #19869).
Behdad Esfahbod [Sat, 31 Jan 2009 08:38:19 +0000 (03:38 -0500)]
[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.
Karl Tomlinson [Tue, 27 Jan 2009 08:35:51 +0000 (03:35 -0500)]
Change FcCharSetMerge API
To only work on writable charsets. Also, return a bool indicating whether
the merge changed the charset.
Also changes the implementation of FcCharSetMerge and FcCharSetIsSubset
Behdad Esfahbod [Fri, 23 Jan 2009 19:17:08 +0000 (14:17 -0500)]
[fcmatch] Fix crash when no fonts are available.
Dan Nicholson [Mon, 19 Jan 2009 22:02:55 +0000 (17:02 -0500)]
Let make expand fc_cachedir/FC_CACHEDIR (bug #18675)
configure replaces a NONE prefix with the default prefix too late.
So we move fonts.conf creation to Makefile, such that prefix is correctly
expanded. Ugly, but works.
Behdad Esfahbod [Fri, 16 Jan 2009 00:27:53 +0000 (19:27 -0500)]
Cleanup all manpage.* files
Recent doc2man generates files called manpage.log. This was breaking build.
Behdad Esfahbod [Fri, 16 Jan 2009 00:12:37 +0000 (19:12 -0500)]
[fc-match] Accept list of elements like fc-list (bug #13017)
Also make --verbose not ignore list of elements and only print those.
Update docs.
Behdad Esfahbod [Fri, 16 Jan 2009 00:12:27 +0000 (19:12 -0500)]
Oops, fix FcPatternFilter
Behdad Esfahbod [Thu, 15 Jan 2009 23:39:48 +0000 (18:39 -0500)]
Add fc-scan too that runs FcFileScan/FcDirScan
This is quite similar to fc-query, but calling FcFileScan/FcDirScan instead
of FcFreeTypeQuery.
Behdad Esfahbod [Thu, 15 Jan 2009 23:35:09 +0000 (18:35 -0500)]
Revive FcConfigScan() (bug #17121)
FcConfigScan() with parameters cache=NULL and force=FcTrue can be used
to scan font dirs without any caching side effect.
Behdad Esfahbod [Thu, 15 Jan 2009 22:34:26 +0000 (17:34 -0500)]
Oops. Fix usage output.
Behdad Esfahbod [Thu, 8 Jan 2009 08:04:34 +0000 (03:04 -0500)]
Don't use FcCharSetCopy in FcCharSetMerge
The Copy function is actually a ref, not real copy.
Behdad Esfahbod [Thu, 8 Jan 2009 01:15:20 +0000 (20:15 -0500)]
Make FcCharSetMerge() public
That's needed for apps to be abled to do pruning themselves without
the performance penalty of recreating new charsets all the time.
Behdad Esfahbod [Thu, 1 Jan 2009 21:29:01 +0000 (16:29 -0500)]
[doc] Note that fontset returned by FcConfigGetFonts should not be modified
Behdad Esfahbod [Thu, 1 Jan 2009 01:16:40 +0000 (20:16 -0500)]
[fcmatch] Move FcFontSetMatch() functionality into FcFontSetMatchInternal()
Except for the final FcFontRenderPrepare(). This way we have more
flexibility to do caching in FcFontMatch() while leaving FcFontSetMatch()
intact.
Behdad Esfahbod [Thu, 1 Jan 2009 00:44:32 +0000 (19:44 -0500)]
[fcmatch] When matching, reserve score 0 for when elements don't exist
Previously an index j was added to element score to prefer matches earlier
in the value list to the later ones. This index started from 0, meaning
that the score zero could be generated for the first element. By starting
j from one, scores for when the element exists in both pattern and font
can never be zero. The score zero is reserved for when the element is
NOT available in both font and pattern. We will use this property later.
This shouldn't change matching much. The only difference I can think of
is that if a font family exists both as a bitmap font and a scalable
version, and when requesting it at the size of the bitmap version,
previously the font returned was nondeterministic. Now the scalable
version will always be preferred.
Behdad Esfahbod [Thu, 1 Jan 2009 00:35:27 +0000 (19:35 -0500)]
[fcmatch] Use larger multipliers to enforce order
Previously the matcher multiplied comparison results by 100 and added
index value to it. With long lists of families (lots of aliases),
reaching 100 is not that hard. That could result in a non-match early
in the list to be preferred over a match late in the list. Changing
the multiplier from 100 to 1000 should fix that.
To keep things relatively in order, the lang multiplier is changed
from 1000 to 10000.
Behdad Esfahbod [Wed, 31 Dec 2008 23:10:31 +0000 (18:10 -0500)]
[fcmatch.c] Fix debug formatting
Behdad Esfahbod [Wed, 31 Dec 2008 23:06:07 +0000 (18:06 -0500)]
Fix comparison of family names to ignore leading space properly
Previously fc-match "xxx,nazli" matched Nazli, but "xxx, nazli" didn't.
This was because of a bug in FcCompareFamily's short-circuit check
that forgot to ignore spaces.
Behdad Esfahbod [Tue, 30 Dec 2008 01:00:26 +0000 (20:00 -0500)]
Implement FcPatternFormat and use it in cmdline tools (bug #17107)
Still need to add more features, but the API is there, and used
by cmdline tools with -f or --format.
Behdad Esfahbod [Tue, 30 Dec 2008 00:27:00 +0000 (19:27 -0500)]
[.gitignore] Update
Behdad Esfahbod [Mon, 29 Dec 2008 23:58:29 +0000 (18:58 -0500)]
Remove special-casing of FC_FILE in FcPatternPrint()
I can't understand why the special case is needed. Indeed, removing it
does not make any difference in the "fc-match --verbose" output, and
that's the only time fc-match uses FcPatternPrint.
Behdad Esfahbod [Sun, 28 Dec 2008 21:54:44 +0000 (16:54 -0500)]
Explicitly chmod() directories (bug #18934)
Two changes:
- after mkdir(), we immediately chmod(), such that we are not affected
by stupid umask's.
- if a directory we want to use is not writable but exists, we try a
chmod on it. This is to recover from stupid umask's having affected
us with older versions.
Behdad Esfahbod [Sun, 28 Dec 2008 14:03:29 +0000 (09:03 -0500)]
Don't use identifier named complex
Behdad Esfahbod [Sun, 28 Dec 2008 13:06:07 +0000 (08:06 -0500)]
[65-fonts-persian.conf] Set foundry in target=scan instead of target=font
Harshula Jayasuriya [Sun, 28 Dec 2008 11:13:19 +0000 (06:13 -0500)]
Fix Sinhala coverage (bug #19288)
Alexey Khoroshilov [Sun, 28 Dec 2008 10:15:45 +0000 (05:15 -0500)]
Use human-readable file names in the docs (bug #16278)
Behdad Esfahbod [Sun, 28 Dec 2008 09:58:14 +0000 (04:58 -0500)]
Implement fc-list --quiet ala grep (bug #17141)
Exits 1 if no fonts matched, 0 otherwise.
Behdad Esfahbod [Sun, 28 Dec 2008 09:48:54 +0000 (04:48 -0500)]
Fix compile with old FreeType that doesn't have FT_Select_Size() (bug #17498)
Behdad Esfahbod [Sun, 28 Dec 2008 09:26:26 +0000 (04:26 -0500)]
Use __builtin_popcount() when available (bug #17592)
Rahul Bhalerao [Sun, 28 Dec 2008 09:10:53 +0000 (04:10 -0500)]
Add config for new Indic fonts (bug #17856)
Behdad Esfahbod [Sun, 28 Dec 2008 09:06:01 +0000 (04:06 -0500)]
Consistently use FcStat() over stat() in all places
Behdad Esfahbod [Sun, 28 Dec 2008 09:00:09 +0000 (04:00 -0500)]
[fccache] Consistently use FcStat() over stat() (bug #18195)
Behdad Esfahbod [Sun, 28 Dec 2008 08:40:21 +0000 (03:40 -0500)]
Cleanup symlinks in "make uninstall" (bug #18885)
Harald Fernengel [Sun, 28 Dec 2008 08:23:58 +0000 (03:23 -0500)]
Don't use variables named 'bool' (bug #18851)
Behdad Esfahbod [Sun, 28 Dec 2008 08:08:38 +0000 (03:08 -0500)]
[.gitignore] Update
Behdad Esfahbod [Tue, 2 Dec 2008 11:07:41 +0000 (06:07 -0500)]
Fix two more doc typos
Behdad Esfahbod [Mon, 22 Sep 2008 22:51:11 +0000 (18:51 -0400)]
Don't call FcPatternGetCharSet in FcSortWalk unless we need to (#17361)
Behdad Esfahbod [Mon, 22 Sep 2008 22:16:30 +0000 (18:16 -0400)]
Don't leak FcValues string loaded through fcxml.c (#17661)
Patch from Caolan McNamara.
Chris Wilson [Wed, 23 Apr 2008 08:07:28 +0000 (09:07 +0100)]
Reduce number of allocations during FcSortWalk().
The current behaviour of FcSortWalk() is to create a new FcCharSet on
each iteration that is the union of the previous iteration with the next
FcCharSet in the font set. This causes the existing FcCharSet to be
reproduced in its entirety and then allocates fresh leaves for the new
FcCharSet. In essence the number of allocations is quadratic wrt the
number of fonts required.
By introducing a new method for merging a new FcCharSet with an existing
one we can change the behaviour to be effectively linear with the number
of fonts - allocating no more leaves than necessary to cover all the
fonts in the set.
For example, profiling 'gedit UTF-8-demo.txt'
Allocator nAllocs nBytes
Before:
FcCharSetFindLeafCreate 62886 2012352
FcCharSetPutLeaf 9361
11441108
After:
FcCharSetFindLeafCreate 1940 62080
FcCharSetPutLeaf 281 190336
The savings are even more significant for applications like firefox-3.0b5
which need to switch between large number of fonts.
Before:
FcCharSetFindLeafCreate 4461192
142758144
FcCharSetPutLeaf 1124536
451574172
After:
FcCharSetFindLeafCreate 80359 2571488
FcCharSetPutLeaf 18940 9720522
Out of interest, the next most frequent allocations are
FcPatternObjectAddWithBinding 526029
10520580
tt_face_load_eblc 42103 2529892
Behdad Esfahbod [Fri, 22 Aug 2008 22:25:22 +0000 (18:25 -0400)]
Document how to free return value of FcNameUnparse()
Behdad Esfahbod [Fri, 22 Aug 2008 22:08:07 +0000 (18:08 -0400)]
Add FcConfigReference() (#17124)
Behdad Esfahbod [Fri, 22 Aug 2008 21:49:02 +0000 (17:49 -0400)]
Document when config can be NULL (#17105)
Note that this also fixes a bug with FcFontList() where previously
it was NOT checking whether the config is up-to-date. May want to
keep the old behavior and document that ScanInterval is essentially
unused internally (FcFontSetList uses it, but we can remove that
too).
Behdad Esfahbod [Fri, 22 Aug 2008 20:51:33 +0000 (16:51 -0400)]
Handle -h and --help according to GNU Coding Standards (#17104)
Added -h instead of -?. And upon -h and --help, write usave to stdout
instead of stdin, and return 0 instead of 1.
-? still works like before as that's what getopt returns upon unknown
arguments.
Behdad Esfahbod [Fri, 22 Aug 2008 17:02:14 +0000 (13:02 -0400)]
Add WenQuanYi fonts to default conf (#17262, from Mandriva)
Behdad Esfahbod [Fri, 22 Aug 2008 07:51:57 +0000 (03:51 -0400)]
Add Sindhi .orth file. (#17140)
Behdad Esfahbod [Thu, 21 Aug 2008 21:17:04 +0000 (17:17 -0400)]
Update sr.orth to actul subset of Cyrillic used by Serbian (#17208)
Behdad Esfahbod [Thu, 14 Aug 2008 19:27:16 +0000 (15:27 -0400)]
Fix docs re 'orig' argument of FcPatternBuild and family
Now call it 'p' or 'pattern', since it's modified in place.
There is no copying.
Behdad Esfahbod [Wed, 13 Aug 2008 20:45:18 +0000 (16:45 -0400)]
[doc] Fix signature of FcConfigHome()
We should write a test to automatically cross-check signatures
from public headers to docs.
Behdad Esfahbod [Wed, 13 Aug 2008 07:30:23 +0000 (03:30 -0400)]
Get rid of $Id$ tags
Behdad Esfahbod [Wed, 13 Aug 2008 07:16:39 +0000 (03:16 -0400)]
[doc] Document that a zero rescanInterval disables automatic checks (#17103)
Behdad Esfahbod [Wed, 13 Aug 2008 06:50:35 +0000 (02:50 -0400)]
Add FcPatternFilter() (#13016)
Behdad Esfahbod [Wed, 13 Aug 2008 06:47:12 +0000 (02:47 -0400)]
[doc] Add const decorator for FcPatternDuplicate()
Behdad Esfahbod [Wed, 13 Aug 2008 06:24:42 +0000 (02:24 -0400)]
Implement fc-list --verbose (#13015)
A private FcObjectGetSet() is implemented that provides an
FcObjectSet of all registered elements. FcFontSetList() is
then modified to use the object set from FcObjectGetSet() if
provided object-set is NULL.
Alternatively FcObjectGetSet() can be made public. In that
case fc-list can use that as a base if --verbose is included,
and also add any elements provided by the user (though that has
no effect, as all elements from the cache are already registered).
Currently fc-list ignores user-provided elements if --verbose
is specified.
Behdad Esfahbod [Wed, 13 Aug 2008 05:31:18 +0000 (01:31 -0400)]
Add fc-query (#13019)
Behdad Esfahbod [Wed, 13 Aug 2008 04:42:12 +0000 (00:42 -0400)]
Update man pages
Behdad Esfahbod [Wed, 13 Aug 2008 03:44:44 +0000 (23:44 -0400)]
[fc-match] Fix list of getopt options in --help
Behdad Esfahbod [Tue, 12 Aug 2008 22:00:35 +0000 (18:00 -0400)]
Add ~/.fonts.conf.d to default config (#17100)
Behdad Esfahbod [Tue, 12 Aug 2008 21:54:45 +0000 (17:54 -0400)]
Update Thai default families (#16223)
Patch from Theppitak Karoonboonyanan
Behdad Esfahbod [Tue, 12 Aug 2008 21:52:02 +0000 (17:52 -0400)]
[doc] Fix signatures of FcPatternGetFTFace and FcPatternGetLangSet (#16272)
Behdad Esfahbod [Tue, 12 Aug 2008 20:34:24 +0000 (16:34 -0400)]
Replace RCS Id tags with the file name
Behdad Esfahbod [Tue, 12 Aug 2008 20:11:29 +0000 (16:11 -0400)]
Add orth file for Maithili mai.orth (#15821)
Behdad Esfahbod [Tue, 12 Aug 2008 19:10:04 +0000 (15:10 -0400)]
When canonizing filenames, squash // and remove final / (#bug 16286)
The fact that we now drop final slashes from all filenames without
checking that the file name represents a directory may surprise some,
but it doesn't bother me really.
Behdad Esfahbod [Tue, 12 Aug 2008 18:32:40 +0000 (14:32 -0400)]
[doc] Fix inaccuracy in FcFontRenderPrepare docs (#16985)
Behdad Esfahbod [Tue, 12 Aug 2008 18:10:03 +0000 (14:10 -0400)]
Avoid C99ism in Win32 code (#16651)