summaryrefslogtreecommitdiff
path: root/src/fclang.c
AgeCommit message (Collapse)AuthorFilesLines
2014-05-13Allow the modification on FcTypeVoid with FcTypeLangSet and FcTypeCharSetAkira TAGOH1-12/+15
FcTypeVoid is likely to happen when 'lang' and 'charset' is deleted by 'delete' or 'delete_all' mode in edit. Without this change, any modification on them are simply ignored. This is useful to make a lot of changes, particularly when one wants to add a few and delete a lot say.
2013-03-05Fix a memory leakAkira TAGOH1-1/+3
2013-01-02Make refcounts, patterns, charsets, strings, and FcLang thread-safeBehdad Esfahbod1-19/+24
2012-12-29Remove memory accounting and reportingBehdad Esfahbod1-16/+1
That belongs in tools like cairo/util/malloc-stat.so
2012-12-29Fix sign-compare warningsBehdad Esfahbod1-3/+3
2012-12-07Fix the wrong estimation for the memory usage information in fontconfigAkira TAGOH1-2/+24
2012-06-08Bug 32853 - Export API to get the default languageAkira TAGOH1-0/+159
Add a new API FcGetDefaultLangs() to export the string sets of the default languages.
2010-12-09Add editing langset feature.Akira TAGOH1-0/+62
The syntax to add any langset to the langset table looks like: <match target="scan"> <test name="family"> <string>Buggy Sans</string> </test> <edit name="lang" mode="assign"> <plus> <name>lang</name> <langset> <string>zh-cn</string> <string>zh-tw</string> </langset> </plus> </edit> </match> To remove any langset from the langset table: <match target="scan"> <test name="family"> <string>Buggy Sans</string> </test> <edit name="lang" mode="assign"> <minus> <name>lang</name> <langset> <string>ja</string> </langset> </minus> </edit> </match>
2010-12-07Bug 28958 - lang=en matches other langsBehdad Esfahbod1-0/+2
Patch from Akira TAGOH.
2010-11-10Cleanup copyright notices to replace "Keith Packard" with "the author(s)"Behdad Esfahbod1-2/+2
2010-04-12Remove all training whitespacesBehdad Esfahbod1-14/+14
2009-11-16[lang] Fix serializing LangSet from older versionsBehdad Esfahbod1-3/+6
2009-11-16[arch] Try to ensure proper FcLangSet alignment in archBehdad Esfahbod1-1/+1
2009-11-16Bump cache version up from 2 to 3 and fix FcLangSet caching/crashBehdad Esfahbod1-15/+52
Protect cache against future expansions of FcLangSet (adding new orth files). Previously, doing so could change the size of that struct. Indeed, that happened between 2.6.0 and 2.7.3, causing crashes. Unfortunately, sizeof(FcLangSet) was not checked in fcarch.c. This changes FcLangSet code to be able to cope with struct size changes. And change cache format, hence bumping from 2 to 3.
2009-08-25Revert "Fix FcNameUnparseLangSet()" and redo itBehdad Esfahbod1-11/+18
This reverts commit 5c6d1ff23bda4386984a1d6e4c024958f8f5547c and fixes that bug using the new reverse-map I added in the previous commit.
2009-08-25Bug 23419 - "contains" expression seems not working on the fontconfig ruleBehdad Esfahbod1-2/+2
Fix bug in FcLangSetContains(), similar to 5c6d1ff23bda4386984a1d6e4c024958f8f5547c
2009-07-28Improve charset printingBehdad Esfahbod1-2/+2
2009-07-22Fix FcNameUnparseLangSet()Behdad Esfahbod1-18/+11
Was broken since ffd6668b469508177c4baf7745ae42aee5b00322
2009-06-24[fc-lang] Make LangSet representation in the cache files stableBehdad Esfahbod1-2/+2
Fontconfig assigns an index number to each language it knows about. The index is used to index a bit in FcLangSet language map. The bit map is stored in the cache. Previously fc-lang simply sorted the list of languages and assigned them an index starting from zero. Net effect is that whenever new orth files were added, all the FcLangSet info in the cache files would become invalid. This was causing weird bugs like this one: https://bugzilla.redhat.com/show_bug.cgi?id=490888 With this commit we fix the index assigned to each language. The index will be based on the order the orth files are passed to fc-lang. As a result all orth files are explicitly listed in Makefile.am now, and new additions should be made to the end of the list. The list is made to reflect the sorted list of orthographies from 2.6.0 released followed by new additions since. This fixes the stability problem. Needless to say, recreating caches is necessary before any new orthography is recognized in existing fonts, but at least the existing caches are still valid and don't cause bugs like the above.
2009-03-13Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all filesBehdad Esfahbod1-2/+2
2009-02-15[fclang] Implement FcLangSetGetLangs() (#18846)Behdad Esfahbod1-0/+32
2009-02-13Replace RCS Id tags with the file nameBehdad Esfahbod1-1/+1
2008-01-07Include fcftaliastail.h so that the freetype funcs are exported.Keith Packard1-0/+1
This header file needs to be included at the end of every file that exports any freetype symbols.
2008-01-02Remove freetype requirement for build-time applications.Keith Packard1-0/+1
This avoids requiring the freetype development files when cross compiling
2007-11-05Add FcGetLangs() and FcLangGetCharSet().Behdad Esfahbod1-2/+18
2007-11-03Use FcLangDifferentTerritory instead of FcLangDifferentCountry.Keith Packard1-4/+4
2007-10-18Place language name in constant array instead of pointer.Keith Packard1-1/+1
Constant char array of 8 bytes is the same size as a pointer plus a short string, so this actually saves memory and eliminates a pile of relocations.
2006-09-05Eliminate .so PLT entries for local symbols. (thanks to Arjan van de Ven)Keith Packard1-0/+3
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-08-30Rework cache files to use offsets for all data structures.Keith Packard1-95/+25
Replace all of the bank/id pairs with simple offsets, recode several data structures to always use offsets inside the library to avoid conditional paths. Exposed data structures use pointers to hold offsets, setting the low bit to distinguish between offset and pointer. Use offset-based data structures for lang charset encodings; eliminates separate data structure format for that file. Much testing will be needed; offsets are likely not detected everywhere in the library yet.
2006-04-11Missing bits from previous patches.Patrick Lam1-0/+1
Remove extra semi-colon. Fix memory leak in error case (Coverity defects #776, #985). Fix memory leaks (Coverity defects #779, #781) and memory use after free (Coverity defect #780). reviewed by: plam
2006-04-11Properly convert static charsets to dynamic charsets.Patrick Lam1-1/+7
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-07Portability fixes for HP-UX (reported by Christoph Bauer). ReplacePatrick Lam1-1/+1
'__inline__' by AC_C_INLINE and 'inline'. Replace '__alignof__' by 'fc_alignof'. reviewed by: plam
2006-04-06Fix intel compiler warnings: make many variables static, eliminatePatrick Lam1-3/+2
duplicate names, reduce variable scopes, unsigned/signed printf formatting. reviewed by: plam
2006-03-03Fix suspicious return expression which causes junk to be returned.Patrick Lam1-1/+1
reviewed by: plam
2005-11-25Pass around FcCache *s to the Unserialize functions for extra consistencyPatrick Lam1-4/+4
(and less overhead, for what that's worth).
2005-11-16Add *NeededBytesAlign(), which overestimates the padding which is laterPatrick Lam1-0/+8
added by the new ALIGN macro. Fix alignment problems on ia64 and s390 by bumping up block_ptr appropriately. (Earlier version by Andreas Schwab). Use sysconf to determine proper PAGESIZE value; this appears to be POSIX-compliant. (reported by Andreas Schwab) reviewed by: plam
2005-11-04Fix bug 2878 (excessive relocations at startup for charsets, reported byPatrick Lam1-1/+15
Ross Burton): fc-lang/fc-lang now creates the static form of the langset, not the dynamic form, so that the charsets should now be in .rodata.
2005-10-14Add consts to variables so as to move arrays into .rodata.Patrick Lam1-2/+2
reviewed by: plam
2005-08-24Overhaul the serialization system to create one mmapable file per directoryPatrick Lam1-123/+90
and distribute bytes for each directory from a single malloc for that directory. Store pointers as differences between the data pointed to and the pointer's address (s_off = s - v). Don't serialize data structures that never actually get serialized. Separate strings used for keys from strings used for values (in FcPatternElt and FcValue, respectively). Bump FC_CACHE_VERSION to 2.
2005-07-25#ifdef out old cache stuff, replace with first version of new mmappingPatrick Lam1-0/+28
cache. Add *Read and *Write procedures which mmap in and write out the fontconfig data structures to disk. Currently, create cache in /tmp, with different sections for each architecture (as returned by uname's .machine field. Run the fc-cache binary to create a new cache file; fontconfig then uses this cache file on subsequent runs, saving lots of memory. Also fixes a few bugs and leaks.
2005-06-28Add functionality to allow fontconfig data structure serialization.Patrick Lam1-37/+127
This patch allows the fundamental fontconfig data structures to be serialized. I've converted everything from FcPattern down to be able to use *Ptr objects, which can be either static or dynamic (using a union which either contains a pointer or an index) and replaced storage of pointers in the heap with the appropriate *Ptr object. I then changed all writes of pointers to the heap with a *CreateDynamic call, which creates a dynamic Ptr object pointing to the same object as before. This way, the fundamental fontconfig semantics should be unchanged; I did not have to change external signatures this way, although I did change some internal signatures. When given a *Ptr object, just run *U to get back to a normal pointer; it gives the right answer regardless of whether we're using static or dynamic storage. I've also implemented a Fc*Serialize call. Calling FcFontSetSerialize converts the dynamic FcFontSets contained in the config object to static FcFontSets and also converts its dependencies (e.g. everything you'd need to write to disk) to static objects. Note that you have to call Fc*PrepareSerialize first; this call will count the number of objects that actually needs to be allocated, so that we can avoid realloc. The Fc*Serialize calls then check the static pointers for nullness, and allocate the buffers if necessary. I've tested the execution of fc-list and fc-match after Fc*Serialize and they appear to work the same way.
2004-12-07Change files from ISO-Latin-1 to UTF-8Keith Packard1-1/+1
2003-07-20Implement new semantics for Contains and LISTING:Keith Packard1-7/+11
LISTING requires that the font Contain all of the pattern values, where Contain is redefined for strings to mean precise matching (so that Courier 10 Pitch doesn't list Courier fonts) "Contains" for lang means both langs have the same language and either the same country or one is missing the country
2003-06-09Optimization in FcLangSetIndex was broken, occasionally returning a pointerKeith Packard1-14/+7
to the wrong location on miss
2003-04-17Remove some unused variables, and initialize some other ones so gcc doesn'tColin Walters1-4/+2
warn us.
2003-03-22switch // commentKeith Packard1-1/+1
2003-03-05AddFcLangSetContains for font listing, add first-letter table for languageKeith Packard1-24/+207
lookups, change RCS tag
2002-12-14633. Perform country-independent matching for Chinese languages inDavid Dawes1-5/+10
fontconfig (#A.1406, Keith Packard).
2002-08-26FcLangSetHasLang was not actually checking the language set itselfKeith Packard1-3/+4
2002-08-22Add contains/not_contains, fix LangSet equal operator to use FcLangEqualKeith Packard1-0/+1