Added fontconfig and expat libs
This commit is contained in:
392
project/jni/fontconfig/src/fcalias.h
Normal file
392
project/jni/fontconfig/src/fcalias.h
Normal file
@@ -0,0 +1,392 @@
|
||||
extern __typeof (FcBlanksCreate) IA__FcBlanksCreate __attribute((visibility("hidden")));
|
||||
#define FcBlanksCreate IA__FcBlanksCreate
|
||||
extern __typeof (FcBlanksDestroy) IA__FcBlanksDestroy __attribute((visibility("hidden")));
|
||||
#define FcBlanksDestroy IA__FcBlanksDestroy
|
||||
extern __typeof (FcBlanksAdd) IA__FcBlanksAdd __attribute((visibility("hidden")));
|
||||
#define FcBlanksAdd IA__FcBlanksAdd
|
||||
extern __typeof (FcBlanksIsMember) IA__FcBlanksIsMember __attribute((visibility("hidden")));
|
||||
#define FcBlanksIsMember IA__FcBlanksIsMember
|
||||
extern __typeof (FcCacheCopySet) IA__FcCacheCopySet __attribute((visibility("hidden")));
|
||||
#define FcCacheCopySet IA__FcCacheCopySet
|
||||
extern __typeof (FcCacheNumSubdir) IA__FcCacheNumSubdir __attribute((visibility("hidden")));
|
||||
#define FcCacheNumSubdir IA__FcCacheNumSubdir
|
||||
extern __typeof (FcCacheNumFont) IA__FcCacheNumFont __attribute((visibility("hidden")));
|
||||
#define FcCacheNumFont IA__FcCacheNumFont
|
||||
extern __typeof (FcDirCacheUnlink) IA__FcDirCacheUnlink __attribute((visibility("hidden")));
|
||||
#define FcDirCacheUnlink IA__FcDirCacheUnlink
|
||||
extern __typeof (FcDirCacheValid) IA__FcDirCacheValid __attribute((visibility("hidden")));
|
||||
#define FcDirCacheValid IA__FcDirCacheValid
|
||||
extern __typeof (FcDirCacheClean) IA__FcDirCacheClean __attribute((visibility("hidden")));
|
||||
#define FcDirCacheClean IA__FcDirCacheClean
|
||||
extern __typeof (FcCacheCreateTagFile) IA__FcCacheCreateTagFile __attribute((visibility("hidden")));
|
||||
#define FcCacheCreateTagFile IA__FcCacheCreateTagFile
|
||||
extern __typeof (FcConfigHome) IA__FcConfigHome __attribute((visibility("hidden")));
|
||||
#define FcConfigHome IA__FcConfigHome
|
||||
extern __typeof (FcConfigEnableHome) IA__FcConfigEnableHome __attribute((visibility("hidden")));
|
||||
#define FcConfigEnableHome IA__FcConfigEnableHome
|
||||
extern __typeof (FcConfigFilename) IA__FcConfigFilename __attribute((visibility("hidden")));
|
||||
#define FcConfigFilename IA__FcConfigFilename
|
||||
extern __typeof (FcConfigCreate) IA__FcConfigCreate __attribute((visibility("hidden")));
|
||||
#define FcConfigCreate IA__FcConfigCreate
|
||||
extern __typeof (FcConfigReference) IA__FcConfigReference __attribute((visibility("hidden")));
|
||||
#define FcConfigReference IA__FcConfigReference
|
||||
extern __typeof (FcConfigDestroy) IA__FcConfigDestroy __attribute((visibility("hidden")));
|
||||
#define FcConfigDestroy IA__FcConfigDestroy
|
||||
extern __typeof (FcConfigSetCurrent) IA__FcConfigSetCurrent __attribute((visibility("hidden")));
|
||||
#define FcConfigSetCurrent IA__FcConfigSetCurrent
|
||||
extern __typeof (FcConfigGetCurrent) IA__FcConfigGetCurrent __attribute((visibility("hidden")));
|
||||
#define FcConfigGetCurrent IA__FcConfigGetCurrent
|
||||
extern __typeof (FcConfigUptoDate) IA__FcConfigUptoDate __attribute((visibility("hidden")));
|
||||
#define FcConfigUptoDate IA__FcConfigUptoDate
|
||||
extern __typeof (FcConfigBuildFonts) IA__FcConfigBuildFonts __attribute((visibility("hidden")));
|
||||
#define FcConfigBuildFonts IA__FcConfigBuildFonts
|
||||
extern __typeof (FcConfigGetFontDirs) IA__FcConfigGetFontDirs __attribute((visibility("hidden")));
|
||||
#define FcConfigGetFontDirs IA__FcConfigGetFontDirs
|
||||
extern __typeof (FcConfigGetConfigDirs) IA__FcConfigGetConfigDirs __attribute((visibility("hidden")));
|
||||
#define FcConfigGetConfigDirs IA__FcConfigGetConfigDirs
|
||||
extern __typeof (FcConfigGetConfigFiles) IA__FcConfigGetConfigFiles __attribute((visibility("hidden")));
|
||||
#define FcConfigGetConfigFiles IA__FcConfigGetConfigFiles
|
||||
extern __typeof (FcConfigGetCache) IA__FcConfigGetCache __attribute((visibility("hidden")));
|
||||
#define FcConfigGetCache IA__FcConfigGetCache
|
||||
extern __typeof (FcConfigGetBlanks) IA__FcConfigGetBlanks __attribute((visibility("hidden")));
|
||||
#define FcConfigGetBlanks IA__FcConfigGetBlanks
|
||||
extern __typeof (FcConfigGetCacheDirs) IA__FcConfigGetCacheDirs __attribute((visibility("hidden")));
|
||||
#define FcConfigGetCacheDirs IA__FcConfigGetCacheDirs
|
||||
extern __typeof (FcConfigGetRescanInterval) IA__FcConfigGetRescanInterval __attribute((visibility("hidden")));
|
||||
#define FcConfigGetRescanInterval IA__FcConfigGetRescanInterval
|
||||
extern __typeof (FcConfigSetRescanInterval) IA__FcConfigSetRescanInterval __attribute((visibility("hidden")));
|
||||
#define FcConfigSetRescanInterval IA__FcConfigSetRescanInterval
|
||||
extern __typeof (FcConfigGetFonts) IA__FcConfigGetFonts __attribute((visibility("hidden")));
|
||||
#define FcConfigGetFonts IA__FcConfigGetFonts
|
||||
extern __typeof (FcConfigAppFontAddFile) IA__FcConfigAppFontAddFile __attribute((visibility("hidden")));
|
||||
#define FcConfigAppFontAddFile IA__FcConfigAppFontAddFile
|
||||
extern __typeof (FcConfigAppFontAddDir) IA__FcConfigAppFontAddDir __attribute((visibility("hidden")));
|
||||
#define FcConfigAppFontAddDir IA__FcConfigAppFontAddDir
|
||||
extern __typeof (FcConfigAppFontClear) IA__FcConfigAppFontClear __attribute((visibility("hidden")));
|
||||
#define FcConfigAppFontClear IA__FcConfigAppFontClear
|
||||
extern __typeof (FcConfigSubstituteWithPat) IA__FcConfigSubstituteWithPat __attribute((visibility("hidden")));
|
||||
#define FcConfigSubstituteWithPat IA__FcConfigSubstituteWithPat
|
||||
extern __typeof (FcConfigSubstitute) IA__FcConfigSubstitute __attribute((visibility("hidden")));
|
||||
#define FcConfigSubstitute IA__FcConfigSubstitute
|
||||
extern __typeof (FcConfigGetSysRoot) IA__FcConfigGetSysRoot __attribute((visibility("hidden")));
|
||||
#define FcConfigGetSysRoot IA__FcConfigGetSysRoot
|
||||
extern __typeof (FcConfigSetSysRoot) IA__FcConfigSetSysRoot __attribute((visibility("hidden")));
|
||||
#define FcConfigSetSysRoot IA__FcConfigSetSysRoot
|
||||
extern __typeof (FcCharSetCreate) IA__FcCharSetCreate __attribute((visibility("hidden")));
|
||||
#define FcCharSetCreate IA__FcCharSetCreate
|
||||
extern __typeof (FcCharSetNew) IA__FcCharSetNew __attribute((visibility("hidden")));
|
||||
#define FcCharSetNew IA__FcCharSetNew
|
||||
extern __typeof (FcCharSetDestroy) IA__FcCharSetDestroy __attribute((visibility("hidden")));
|
||||
#define FcCharSetDestroy IA__FcCharSetDestroy
|
||||
extern __typeof (FcCharSetAddChar) IA__FcCharSetAddChar __attribute((visibility("hidden")));
|
||||
#define FcCharSetAddChar IA__FcCharSetAddChar
|
||||
extern __typeof (FcCharSetDelChar) IA__FcCharSetDelChar __attribute((visibility("hidden")));
|
||||
#define FcCharSetDelChar IA__FcCharSetDelChar
|
||||
extern __typeof (FcCharSetCopy) IA__FcCharSetCopy __attribute((visibility("hidden")));
|
||||
#define FcCharSetCopy IA__FcCharSetCopy
|
||||
extern __typeof (FcCharSetEqual) IA__FcCharSetEqual __attribute((visibility("hidden")));
|
||||
#define FcCharSetEqual IA__FcCharSetEqual
|
||||
extern __typeof (FcCharSetIntersect) IA__FcCharSetIntersect __attribute((visibility("hidden")));
|
||||
#define FcCharSetIntersect IA__FcCharSetIntersect
|
||||
extern __typeof (FcCharSetUnion) IA__FcCharSetUnion __attribute((visibility("hidden")));
|
||||
#define FcCharSetUnion IA__FcCharSetUnion
|
||||
extern __typeof (FcCharSetSubtract) IA__FcCharSetSubtract __attribute((visibility("hidden")));
|
||||
#define FcCharSetSubtract IA__FcCharSetSubtract
|
||||
extern __typeof (FcCharSetMerge) IA__FcCharSetMerge __attribute((visibility("hidden")));
|
||||
#define FcCharSetMerge IA__FcCharSetMerge
|
||||
extern __typeof (FcCharSetHasChar) IA__FcCharSetHasChar __attribute((visibility("hidden")));
|
||||
#define FcCharSetHasChar IA__FcCharSetHasChar
|
||||
extern __typeof (FcCharSetCount) IA__FcCharSetCount __attribute((visibility("hidden")));
|
||||
#define FcCharSetCount IA__FcCharSetCount
|
||||
extern __typeof (FcCharSetIntersectCount) IA__FcCharSetIntersectCount __attribute((visibility("hidden")));
|
||||
#define FcCharSetIntersectCount IA__FcCharSetIntersectCount
|
||||
extern __typeof (FcCharSetSubtractCount) IA__FcCharSetSubtractCount __attribute((visibility("hidden")));
|
||||
#define FcCharSetSubtractCount IA__FcCharSetSubtractCount
|
||||
extern __typeof (FcCharSetIsSubset) IA__FcCharSetIsSubset __attribute((visibility("hidden")));
|
||||
#define FcCharSetIsSubset IA__FcCharSetIsSubset
|
||||
extern __typeof (FcCharSetFirstPage) IA__FcCharSetFirstPage __attribute((visibility("hidden")));
|
||||
#define FcCharSetFirstPage IA__FcCharSetFirstPage
|
||||
extern __typeof (FcCharSetNextPage) IA__FcCharSetNextPage __attribute((visibility("hidden")));
|
||||
#define FcCharSetNextPage IA__FcCharSetNextPage
|
||||
extern __typeof (FcCharSetCoverage) IA__FcCharSetCoverage __attribute((visibility("hidden")));
|
||||
#define FcCharSetCoverage IA__FcCharSetCoverage
|
||||
extern __typeof (FcValuePrint) IA__FcValuePrint __attribute((visibility("hidden")));
|
||||
#define FcValuePrint IA__FcValuePrint
|
||||
extern __typeof (FcPatternPrint) IA__FcPatternPrint __attribute((visibility("hidden")));
|
||||
#define FcPatternPrint IA__FcPatternPrint
|
||||
extern __typeof (FcFontSetPrint) IA__FcFontSetPrint __attribute((visibility("hidden")));
|
||||
#define FcFontSetPrint IA__FcFontSetPrint
|
||||
extern __typeof (FcGetDefaultLangs) IA__FcGetDefaultLangs __attribute((visibility("hidden")));
|
||||
#define FcGetDefaultLangs IA__FcGetDefaultLangs
|
||||
extern __typeof (FcDefaultSubstitute) IA__FcDefaultSubstitute __attribute((visibility("hidden")));
|
||||
#define FcDefaultSubstitute IA__FcDefaultSubstitute
|
||||
extern __typeof (FcFileIsDir) IA__FcFileIsDir __attribute((visibility("hidden")));
|
||||
#define FcFileIsDir IA__FcFileIsDir
|
||||
extern __typeof (FcFileScan) IA__FcFileScan __attribute((visibility("hidden")));
|
||||
#define FcFileScan IA__FcFileScan
|
||||
extern __typeof (FcDirScan) IA__FcDirScan __attribute((visibility("hidden")));
|
||||
#define FcDirScan IA__FcDirScan
|
||||
extern __typeof (FcDirSave) IA__FcDirSave __attribute((visibility("hidden")));
|
||||
#define FcDirSave IA__FcDirSave
|
||||
extern __typeof (FcDirCacheLoad) IA__FcDirCacheLoad __attribute((visibility("hidden")));
|
||||
#define FcDirCacheLoad IA__FcDirCacheLoad
|
||||
extern __typeof (FcDirCacheRescan) IA__FcDirCacheRescan __attribute((visibility("hidden")));
|
||||
#define FcDirCacheRescan IA__FcDirCacheRescan
|
||||
extern __typeof (FcDirCacheRead) IA__FcDirCacheRead __attribute((visibility("hidden")));
|
||||
#define FcDirCacheRead IA__FcDirCacheRead
|
||||
extern __typeof (FcDirCacheLoadFile) IA__FcDirCacheLoadFile __attribute((visibility("hidden")));
|
||||
#define FcDirCacheLoadFile IA__FcDirCacheLoadFile
|
||||
extern __typeof (FcDirCacheUnload) IA__FcDirCacheUnload __attribute((visibility("hidden")));
|
||||
#define FcDirCacheUnload IA__FcDirCacheUnload
|
||||
extern __typeof (FcFreeTypeQuery) IA__FcFreeTypeQuery __attribute((visibility("hidden")));
|
||||
#define FcFreeTypeQuery IA__FcFreeTypeQuery
|
||||
extern __typeof (FcFontSetCreate) IA__FcFontSetCreate __attribute((visibility("hidden")));
|
||||
#define FcFontSetCreate IA__FcFontSetCreate
|
||||
extern __typeof (FcFontSetDestroy) IA__FcFontSetDestroy __attribute((visibility("hidden")));
|
||||
#define FcFontSetDestroy IA__FcFontSetDestroy
|
||||
extern __typeof (FcFontSetAdd) IA__FcFontSetAdd __attribute((visibility("hidden")));
|
||||
#define FcFontSetAdd IA__FcFontSetAdd
|
||||
extern __typeof (FcInitLoadConfig) IA__FcInitLoadConfig __attribute((visibility("hidden")));
|
||||
#define FcInitLoadConfig IA__FcInitLoadConfig
|
||||
extern __typeof (FcInitLoadConfigAndFonts) IA__FcInitLoadConfigAndFonts __attribute((visibility("hidden")));
|
||||
#define FcInitLoadConfigAndFonts IA__FcInitLoadConfigAndFonts
|
||||
extern __typeof (FcInit) IA__FcInit __attribute((visibility("hidden")));
|
||||
#define FcInit IA__FcInit
|
||||
extern __typeof (FcFini) IA__FcFini __attribute((visibility("hidden")));
|
||||
#define FcFini IA__FcFini
|
||||
extern __typeof (FcGetVersion) IA__FcGetVersion __attribute((visibility("hidden")));
|
||||
#define FcGetVersion IA__FcGetVersion
|
||||
extern __typeof (FcInitReinitialize) IA__FcInitReinitialize __attribute((visibility("hidden")));
|
||||
#define FcInitReinitialize IA__FcInitReinitialize
|
||||
extern __typeof (FcInitBringUptoDate) IA__FcInitBringUptoDate __attribute((visibility("hidden")));
|
||||
#define FcInitBringUptoDate IA__FcInitBringUptoDate
|
||||
extern __typeof (FcGetLangs) IA__FcGetLangs __attribute((visibility("hidden")));
|
||||
#define FcGetLangs IA__FcGetLangs
|
||||
extern __typeof (FcLangNormalize) IA__FcLangNormalize __attribute((visibility("hidden")));
|
||||
#define FcLangNormalize IA__FcLangNormalize
|
||||
extern __typeof (FcLangGetCharSet) IA__FcLangGetCharSet __attribute((visibility("hidden")));
|
||||
#define FcLangGetCharSet IA__FcLangGetCharSet
|
||||
extern __typeof (FcLangSetCreate) IA__FcLangSetCreate __attribute((visibility("hidden")));
|
||||
#define FcLangSetCreate IA__FcLangSetCreate
|
||||
extern __typeof (FcLangSetDestroy) IA__FcLangSetDestroy __attribute((visibility("hidden")));
|
||||
#define FcLangSetDestroy IA__FcLangSetDestroy
|
||||
extern __typeof (FcLangSetCopy) IA__FcLangSetCopy __attribute((visibility("hidden")));
|
||||
#define FcLangSetCopy IA__FcLangSetCopy
|
||||
extern __typeof (FcLangSetAdd) IA__FcLangSetAdd __attribute((visibility("hidden")));
|
||||
#define FcLangSetAdd IA__FcLangSetAdd
|
||||
extern __typeof (FcLangSetDel) IA__FcLangSetDel __attribute((visibility("hidden")));
|
||||
#define FcLangSetDel IA__FcLangSetDel
|
||||
extern __typeof (FcLangSetHasLang) IA__FcLangSetHasLang __attribute((visibility("hidden")));
|
||||
#define FcLangSetHasLang IA__FcLangSetHasLang
|
||||
extern __typeof (FcLangSetCompare) IA__FcLangSetCompare __attribute((visibility("hidden")));
|
||||
#define FcLangSetCompare IA__FcLangSetCompare
|
||||
extern __typeof (FcLangSetContains) IA__FcLangSetContains __attribute((visibility("hidden")));
|
||||
#define FcLangSetContains IA__FcLangSetContains
|
||||
extern __typeof (FcLangSetEqual) IA__FcLangSetEqual __attribute((visibility("hidden")));
|
||||
#define FcLangSetEqual IA__FcLangSetEqual
|
||||
extern __typeof (FcLangSetHash) IA__FcLangSetHash __attribute((visibility("hidden")));
|
||||
#define FcLangSetHash IA__FcLangSetHash
|
||||
extern __typeof (FcLangSetGetLangs) IA__FcLangSetGetLangs __attribute((visibility("hidden")));
|
||||
#define FcLangSetGetLangs IA__FcLangSetGetLangs
|
||||
extern __typeof (FcLangSetUnion) IA__FcLangSetUnion __attribute((visibility("hidden")));
|
||||
#define FcLangSetUnion IA__FcLangSetUnion
|
||||
extern __typeof (FcLangSetSubtract) IA__FcLangSetSubtract __attribute((visibility("hidden")));
|
||||
#define FcLangSetSubtract IA__FcLangSetSubtract
|
||||
extern __typeof (FcObjectSetCreate) IA__FcObjectSetCreate __attribute((visibility("hidden")));
|
||||
#define FcObjectSetCreate IA__FcObjectSetCreate
|
||||
extern __typeof (FcObjectSetAdd) IA__FcObjectSetAdd __attribute((visibility("hidden")));
|
||||
#define FcObjectSetAdd IA__FcObjectSetAdd
|
||||
extern __typeof (FcObjectSetDestroy) IA__FcObjectSetDestroy __attribute((visibility("hidden")));
|
||||
#define FcObjectSetDestroy IA__FcObjectSetDestroy
|
||||
extern __typeof (FcObjectSetVaBuild) IA__FcObjectSetVaBuild __attribute((visibility("hidden")));
|
||||
#define FcObjectSetVaBuild IA__FcObjectSetVaBuild
|
||||
extern __typeof (FcObjectSetBuild) IA__FcObjectSetBuild __attribute((visibility("hidden")));
|
||||
#define FcObjectSetBuild IA__FcObjectSetBuild
|
||||
extern __typeof (FcFontSetList) IA__FcFontSetList __attribute((visibility("hidden")));
|
||||
#define FcFontSetList IA__FcFontSetList
|
||||
extern __typeof (FcFontList) IA__FcFontList __attribute((visibility("hidden")));
|
||||
#define FcFontList IA__FcFontList
|
||||
extern __typeof (FcAtomicCreate) IA__FcAtomicCreate __attribute((visibility("hidden")));
|
||||
#define FcAtomicCreate IA__FcAtomicCreate
|
||||
extern __typeof (FcAtomicLock) IA__FcAtomicLock __attribute((visibility("hidden")));
|
||||
#define FcAtomicLock IA__FcAtomicLock
|
||||
extern __typeof (FcAtomicNewFile) IA__FcAtomicNewFile __attribute((visibility("hidden")));
|
||||
#define FcAtomicNewFile IA__FcAtomicNewFile
|
||||
extern __typeof (FcAtomicOrigFile) IA__FcAtomicOrigFile __attribute((visibility("hidden")));
|
||||
#define FcAtomicOrigFile IA__FcAtomicOrigFile
|
||||
extern __typeof (FcAtomicReplaceOrig) IA__FcAtomicReplaceOrig __attribute((visibility("hidden")));
|
||||
#define FcAtomicReplaceOrig IA__FcAtomicReplaceOrig
|
||||
extern __typeof (FcAtomicDeleteNew) IA__FcAtomicDeleteNew __attribute((visibility("hidden")));
|
||||
#define FcAtomicDeleteNew IA__FcAtomicDeleteNew
|
||||
extern __typeof (FcAtomicUnlock) IA__FcAtomicUnlock __attribute((visibility("hidden")));
|
||||
#define FcAtomicUnlock IA__FcAtomicUnlock
|
||||
extern __typeof (FcAtomicDestroy) IA__FcAtomicDestroy __attribute((visibility("hidden")));
|
||||
#define FcAtomicDestroy IA__FcAtomicDestroy
|
||||
extern __typeof (FcFontSetMatch) IA__FcFontSetMatch __attribute((visibility("hidden")));
|
||||
#define FcFontSetMatch IA__FcFontSetMatch
|
||||
extern __typeof (FcFontMatch) IA__FcFontMatch __attribute((visibility("hidden")));
|
||||
#define FcFontMatch IA__FcFontMatch
|
||||
extern __typeof (FcFontRenderPrepare) IA__FcFontRenderPrepare __attribute((visibility("hidden")));
|
||||
#define FcFontRenderPrepare IA__FcFontRenderPrepare
|
||||
extern __typeof (FcFontSetSort) IA__FcFontSetSort __attribute((visibility("hidden")));
|
||||
#define FcFontSetSort IA__FcFontSetSort
|
||||
extern __typeof (FcFontSort) IA__FcFontSort __attribute((visibility("hidden")));
|
||||
#define FcFontSort IA__FcFontSort
|
||||
extern __typeof (FcFontSetSortDestroy) IA__FcFontSetSortDestroy __attribute((visibility("hidden")));
|
||||
#define FcFontSetSortDestroy IA__FcFontSetSortDestroy
|
||||
extern __typeof (FcMatrixCopy) IA__FcMatrixCopy __attribute((visibility("hidden")));
|
||||
#define FcMatrixCopy IA__FcMatrixCopy
|
||||
extern __typeof (FcMatrixEqual) IA__FcMatrixEqual __attribute((visibility("hidden")));
|
||||
#define FcMatrixEqual IA__FcMatrixEqual
|
||||
extern __typeof (FcMatrixMultiply) IA__FcMatrixMultiply __attribute((visibility("hidden")));
|
||||
#define FcMatrixMultiply IA__FcMatrixMultiply
|
||||
extern __typeof (FcMatrixRotate) IA__FcMatrixRotate __attribute((visibility("hidden")));
|
||||
#define FcMatrixRotate IA__FcMatrixRotate
|
||||
extern __typeof (FcMatrixScale) IA__FcMatrixScale __attribute((visibility("hidden")));
|
||||
#define FcMatrixScale IA__FcMatrixScale
|
||||
extern __typeof (FcMatrixShear) IA__FcMatrixShear __attribute((visibility("hidden")));
|
||||
#define FcMatrixShear IA__FcMatrixShear
|
||||
extern __typeof (FcNameRegisterObjectTypes) IA__FcNameRegisterObjectTypes __attribute((visibility("hidden")));
|
||||
#define FcNameRegisterObjectTypes IA__FcNameRegisterObjectTypes
|
||||
extern __typeof (FcNameUnregisterObjectTypes) IA__FcNameUnregisterObjectTypes __attribute((visibility("hidden")));
|
||||
#define FcNameUnregisterObjectTypes IA__FcNameUnregisterObjectTypes
|
||||
extern __typeof (FcNameGetObjectType) IA__FcNameGetObjectType __attribute((visibility("hidden")));
|
||||
#define FcNameGetObjectType IA__FcNameGetObjectType
|
||||
extern __typeof (FcNameRegisterConstants) IA__FcNameRegisterConstants __attribute((visibility("hidden")));
|
||||
#define FcNameRegisterConstants IA__FcNameRegisterConstants
|
||||
extern __typeof (FcNameUnregisterConstants) IA__FcNameUnregisterConstants __attribute((visibility("hidden")));
|
||||
#define FcNameUnregisterConstants IA__FcNameUnregisterConstants
|
||||
extern __typeof (FcNameGetConstant) IA__FcNameGetConstant __attribute((visibility("hidden")));
|
||||
#define FcNameGetConstant IA__FcNameGetConstant
|
||||
extern __typeof (FcNameConstant) IA__FcNameConstant __attribute((visibility("hidden")));
|
||||
#define FcNameConstant IA__FcNameConstant
|
||||
extern __typeof (FcNameParse) IA__FcNameParse __attribute((visibility("hidden")));
|
||||
#define FcNameParse IA__FcNameParse
|
||||
extern __typeof (FcNameUnparse) IA__FcNameUnparse __attribute((visibility("hidden")));
|
||||
#define FcNameUnparse IA__FcNameUnparse
|
||||
extern __typeof (FcPatternCreate) IA__FcPatternCreate __attribute((visibility("hidden")));
|
||||
#define FcPatternCreate IA__FcPatternCreate
|
||||
extern __typeof (FcPatternDuplicate) IA__FcPatternDuplicate __attribute((visibility("hidden")));
|
||||
#define FcPatternDuplicate IA__FcPatternDuplicate
|
||||
extern __typeof (FcPatternReference) IA__FcPatternReference __attribute((visibility("hidden")));
|
||||
#define FcPatternReference IA__FcPatternReference
|
||||
extern __typeof (FcPatternFilter) IA__FcPatternFilter __attribute((visibility("hidden")));
|
||||
#define FcPatternFilter IA__FcPatternFilter
|
||||
extern __typeof (FcValueDestroy) IA__FcValueDestroy __attribute((visibility("hidden")));
|
||||
#define FcValueDestroy IA__FcValueDestroy
|
||||
extern __typeof (FcValueEqual) IA__FcValueEqual __attribute((visibility("hidden")));
|
||||
#define FcValueEqual IA__FcValueEqual
|
||||
extern __typeof (FcValueSave) IA__FcValueSave __attribute((visibility("hidden")));
|
||||
#define FcValueSave IA__FcValueSave
|
||||
extern __typeof (FcPatternDestroy) IA__FcPatternDestroy __attribute((visibility("hidden")));
|
||||
#define FcPatternDestroy IA__FcPatternDestroy
|
||||
extern __typeof (FcPatternEqual) IA__FcPatternEqual __attribute((visibility("hidden")));
|
||||
#define FcPatternEqual IA__FcPatternEqual
|
||||
extern __typeof (FcPatternEqualSubset) IA__FcPatternEqualSubset __attribute((visibility("hidden")));
|
||||
#define FcPatternEqualSubset IA__FcPatternEqualSubset
|
||||
extern __typeof (FcPatternHash) IA__FcPatternHash __attribute((visibility("hidden")));
|
||||
#define FcPatternHash IA__FcPatternHash
|
||||
extern __typeof (FcPatternAdd) IA__FcPatternAdd __attribute((visibility("hidden")));
|
||||
#define FcPatternAdd IA__FcPatternAdd
|
||||
extern __typeof (FcPatternAddWeak) IA__FcPatternAddWeak __attribute((visibility("hidden")));
|
||||
#define FcPatternAddWeak IA__FcPatternAddWeak
|
||||
extern __typeof (FcPatternGet) IA__FcPatternGet __attribute((visibility("hidden")));
|
||||
#define FcPatternGet IA__FcPatternGet
|
||||
extern __typeof (FcPatternDel) IA__FcPatternDel __attribute((visibility("hidden")));
|
||||
#define FcPatternDel IA__FcPatternDel
|
||||
extern __typeof (FcPatternRemove) IA__FcPatternRemove __attribute((visibility("hidden")));
|
||||
#define FcPatternRemove IA__FcPatternRemove
|
||||
extern __typeof (FcPatternAddInteger) IA__FcPatternAddInteger __attribute((visibility("hidden")));
|
||||
#define FcPatternAddInteger IA__FcPatternAddInteger
|
||||
extern __typeof (FcPatternAddDouble) IA__FcPatternAddDouble __attribute((visibility("hidden")));
|
||||
#define FcPatternAddDouble IA__FcPatternAddDouble
|
||||
extern __typeof (FcPatternAddString) IA__FcPatternAddString __attribute((visibility("hidden")));
|
||||
#define FcPatternAddString IA__FcPatternAddString
|
||||
extern __typeof (FcPatternAddMatrix) IA__FcPatternAddMatrix __attribute((visibility("hidden")));
|
||||
#define FcPatternAddMatrix IA__FcPatternAddMatrix
|
||||
extern __typeof (FcPatternAddCharSet) IA__FcPatternAddCharSet __attribute((visibility("hidden")));
|
||||
#define FcPatternAddCharSet IA__FcPatternAddCharSet
|
||||
extern __typeof (FcPatternAddBool) IA__FcPatternAddBool __attribute((visibility("hidden")));
|
||||
#define FcPatternAddBool IA__FcPatternAddBool
|
||||
extern __typeof (FcPatternAddLangSet) IA__FcPatternAddLangSet __attribute((visibility("hidden")));
|
||||
#define FcPatternAddLangSet IA__FcPatternAddLangSet
|
||||
extern __typeof (FcPatternGetInteger) IA__FcPatternGetInteger __attribute((visibility("hidden")));
|
||||
#define FcPatternGetInteger IA__FcPatternGetInteger
|
||||
extern __typeof (FcPatternGetDouble) IA__FcPatternGetDouble __attribute((visibility("hidden")));
|
||||
#define FcPatternGetDouble IA__FcPatternGetDouble
|
||||
extern __typeof (FcPatternGetString) IA__FcPatternGetString __attribute((visibility("hidden")));
|
||||
#define FcPatternGetString IA__FcPatternGetString
|
||||
extern __typeof (FcPatternGetMatrix) IA__FcPatternGetMatrix __attribute((visibility("hidden")));
|
||||
#define FcPatternGetMatrix IA__FcPatternGetMatrix
|
||||
extern __typeof (FcPatternGetCharSet) IA__FcPatternGetCharSet __attribute((visibility("hidden")));
|
||||
#define FcPatternGetCharSet IA__FcPatternGetCharSet
|
||||
extern __typeof (FcPatternGetBool) IA__FcPatternGetBool __attribute((visibility("hidden")));
|
||||
#define FcPatternGetBool IA__FcPatternGetBool
|
||||
extern __typeof (FcPatternGetLangSet) IA__FcPatternGetLangSet __attribute((visibility("hidden")));
|
||||
#define FcPatternGetLangSet IA__FcPatternGetLangSet
|
||||
extern __typeof (FcPatternVaBuild) IA__FcPatternVaBuild __attribute((visibility("hidden")));
|
||||
#define FcPatternVaBuild IA__FcPatternVaBuild
|
||||
extern __typeof (FcPatternBuild) IA__FcPatternBuild __attribute((visibility("hidden")));
|
||||
#define FcPatternBuild IA__FcPatternBuild
|
||||
extern __typeof (FcPatternFormat) IA__FcPatternFormat __attribute((visibility("hidden")));
|
||||
#define FcPatternFormat IA__FcPatternFormat
|
||||
extern __typeof (FcStrCopy) IA__FcStrCopy __attribute((visibility("hidden")));
|
||||
#define FcStrCopy IA__FcStrCopy
|
||||
extern __typeof (FcStrCopyFilename) IA__FcStrCopyFilename __attribute((visibility("hidden")));
|
||||
#define FcStrCopyFilename IA__FcStrCopyFilename
|
||||
extern __typeof (FcStrPlus) IA__FcStrPlus __attribute((visibility("hidden")));
|
||||
#define FcStrPlus IA__FcStrPlus
|
||||
extern __typeof (FcStrFree) IA__FcStrFree __attribute((visibility("hidden")));
|
||||
#define FcStrFree IA__FcStrFree
|
||||
extern __typeof (FcStrDowncase) IA__FcStrDowncase __attribute((visibility("hidden")));
|
||||
#define FcStrDowncase IA__FcStrDowncase
|
||||
extern __typeof (FcStrCmpIgnoreCase) IA__FcStrCmpIgnoreCase __attribute((visibility("hidden")));
|
||||
#define FcStrCmpIgnoreCase IA__FcStrCmpIgnoreCase
|
||||
extern __typeof (FcStrCmp) IA__FcStrCmp __attribute((visibility("hidden")));
|
||||
#define FcStrCmp IA__FcStrCmp
|
||||
extern __typeof (FcStrStrIgnoreCase) IA__FcStrStrIgnoreCase __attribute((visibility("hidden")));
|
||||
#define FcStrStrIgnoreCase IA__FcStrStrIgnoreCase
|
||||
extern __typeof (FcStrStr) IA__FcStrStr __attribute((visibility("hidden")));
|
||||
#define FcStrStr IA__FcStrStr
|
||||
extern __typeof (FcUtf8ToUcs4) IA__FcUtf8ToUcs4 __attribute((visibility("hidden")));
|
||||
#define FcUtf8ToUcs4 IA__FcUtf8ToUcs4
|
||||
extern __typeof (FcUtf8Len) IA__FcUtf8Len __attribute((visibility("hidden")));
|
||||
#define FcUtf8Len IA__FcUtf8Len
|
||||
extern __typeof (FcUcs4ToUtf8) IA__FcUcs4ToUtf8 __attribute((visibility("hidden")));
|
||||
#define FcUcs4ToUtf8 IA__FcUcs4ToUtf8
|
||||
extern __typeof (FcUtf16ToUcs4) IA__FcUtf16ToUcs4 __attribute((visibility("hidden")));
|
||||
#define FcUtf16ToUcs4 IA__FcUtf16ToUcs4
|
||||
extern __typeof (FcUtf16Len) IA__FcUtf16Len __attribute((visibility("hidden")));
|
||||
#define FcUtf16Len IA__FcUtf16Len
|
||||
extern __typeof (FcStrDirname) IA__FcStrDirname __attribute((visibility("hidden")));
|
||||
#define FcStrDirname IA__FcStrDirname
|
||||
extern __typeof (FcStrBasename) IA__FcStrBasename __attribute((visibility("hidden")));
|
||||
#define FcStrBasename IA__FcStrBasename
|
||||
extern __typeof (FcStrSetCreate) IA__FcStrSetCreate __attribute((visibility("hidden")));
|
||||
#define FcStrSetCreate IA__FcStrSetCreate
|
||||
extern __typeof (FcStrSetMember) IA__FcStrSetMember __attribute((visibility("hidden")));
|
||||
#define FcStrSetMember IA__FcStrSetMember
|
||||
extern __typeof (FcStrSetEqual) IA__FcStrSetEqual __attribute((visibility("hidden")));
|
||||
#define FcStrSetEqual IA__FcStrSetEqual
|
||||
extern __typeof (FcStrSetAdd) IA__FcStrSetAdd __attribute((visibility("hidden")));
|
||||
#define FcStrSetAdd IA__FcStrSetAdd
|
||||
extern __typeof (FcStrSetAddFilename) IA__FcStrSetAddFilename __attribute((visibility("hidden")));
|
||||
#define FcStrSetAddFilename IA__FcStrSetAddFilename
|
||||
extern __typeof (FcStrSetDel) IA__FcStrSetDel __attribute((visibility("hidden")));
|
||||
#define FcStrSetDel IA__FcStrSetDel
|
||||
extern __typeof (FcStrSetDestroy) IA__FcStrSetDestroy __attribute((visibility("hidden")));
|
||||
#define FcStrSetDestroy IA__FcStrSetDestroy
|
||||
extern __typeof (FcStrListCreate) IA__FcStrListCreate __attribute((visibility("hidden")));
|
||||
#define FcStrListCreate IA__FcStrListCreate
|
||||
extern __typeof (FcStrListFirst) IA__FcStrListFirst __attribute((visibility("hidden")));
|
||||
#define FcStrListFirst IA__FcStrListFirst
|
||||
extern __typeof (FcStrListNext) IA__FcStrListNext __attribute((visibility("hidden")));
|
||||
#define FcStrListNext IA__FcStrListNext
|
||||
extern __typeof (FcStrListDone) IA__FcStrListDone __attribute((visibility("hidden")));
|
||||
#define FcStrListDone IA__FcStrListDone
|
||||
extern __typeof (FcConfigParseAndLoad) IA__FcConfigParseAndLoad __attribute((visibility("hidden")));
|
||||
#define FcConfigParseAndLoad IA__FcConfigParseAndLoad
|
||||
extern __typeof (FcConfigGetRescanInverval) IA__FcConfigGetRescanInverval __attribute((visibility("hidden")));
|
||||
#define FcConfigGetRescanInverval IA__FcConfigGetRescanInverval
|
||||
extern __typeof (FcConfigSetRescanInverval) IA__FcConfigSetRescanInverval __attribute((visibility("hidden")));
|
||||
#define FcConfigSetRescanInverval IA__FcConfigSetRescanInverval
|
||||
442
project/jni/fontconfig/src/fcaliastail.h
Normal file
442
project/jni/fontconfig/src/fcaliastail.h
Normal file
@@ -0,0 +1,442 @@
|
||||
#if HAVE_GNUC_ATTRIBUTE
|
||||
#ifdef __fcblanks__
|
||||
# undef FcBlanksCreate
|
||||
extern __typeof (FcBlanksCreate) FcBlanksCreate __attribute((alias("IA__FcBlanksCreate"), visibility("default")));
|
||||
# undef FcBlanksDestroy
|
||||
extern __typeof (FcBlanksDestroy) FcBlanksDestroy __attribute((alias("IA__FcBlanksDestroy"), visibility("default")));
|
||||
# undef FcBlanksAdd
|
||||
extern __typeof (FcBlanksAdd) FcBlanksAdd __attribute((alias("IA__FcBlanksAdd"), visibility("default")));
|
||||
# undef FcBlanksIsMember
|
||||
extern __typeof (FcBlanksIsMember) FcBlanksIsMember __attribute((alias("IA__FcBlanksIsMember"), visibility("default")));
|
||||
#endif /* __fcblanks__ */
|
||||
#ifdef __fccache__
|
||||
# undef FcCacheCopySet
|
||||
extern __typeof (FcCacheCopySet) FcCacheCopySet __attribute((alias("IA__FcCacheCopySet"), visibility("default")));
|
||||
# undef FcCacheNumSubdir
|
||||
extern __typeof (FcCacheNumSubdir) FcCacheNumSubdir __attribute((alias("IA__FcCacheNumSubdir"), visibility("default")));
|
||||
# undef FcCacheNumFont
|
||||
extern __typeof (FcCacheNumFont) FcCacheNumFont __attribute((alias("IA__FcCacheNumFont"), visibility("default")));
|
||||
# undef FcDirCacheUnlink
|
||||
extern __typeof (FcDirCacheUnlink) FcDirCacheUnlink __attribute((alias("IA__FcDirCacheUnlink"), visibility("default")));
|
||||
# undef FcDirCacheValid
|
||||
extern __typeof (FcDirCacheValid) FcDirCacheValid __attribute((alias("IA__FcDirCacheValid"), visibility("default")));
|
||||
# undef FcDirCacheClean
|
||||
extern __typeof (FcDirCacheClean) FcDirCacheClean __attribute((alias("IA__FcDirCacheClean"), visibility("default")));
|
||||
# undef FcCacheCreateTagFile
|
||||
extern __typeof (FcCacheCreateTagFile) FcCacheCreateTagFile __attribute((alias("IA__FcCacheCreateTagFile"), visibility("default")));
|
||||
#endif /* __fccache__ */
|
||||
#ifdef __fccfg__
|
||||
# undef FcConfigHome
|
||||
extern __typeof (FcConfigHome) FcConfigHome __attribute((alias("IA__FcConfigHome"), visibility("default")));
|
||||
# undef FcConfigEnableHome
|
||||
extern __typeof (FcConfigEnableHome) FcConfigEnableHome __attribute((alias("IA__FcConfigEnableHome"), visibility("default")));
|
||||
# undef FcConfigFilename
|
||||
extern __typeof (FcConfigFilename) FcConfigFilename __attribute((alias("IA__FcConfigFilename"), visibility("default")));
|
||||
# undef FcConfigCreate
|
||||
extern __typeof (FcConfigCreate) FcConfigCreate __attribute((alias("IA__FcConfigCreate"), visibility("default")));
|
||||
# undef FcConfigReference
|
||||
extern __typeof (FcConfigReference) FcConfigReference __attribute((alias("IA__FcConfigReference"), visibility("default")));
|
||||
# undef FcConfigDestroy
|
||||
extern __typeof (FcConfigDestroy) FcConfigDestroy __attribute((alias("IA__FcConfigDestroy"), visibility("default")));
|
||||
# undef FcConfigSetCurrent
|
||||
extern __typeof (FcConfigSetCurrent) FcConfigSetCurrent __attribute((alias("IA__FcConfigSetCurrent"), visibility("default")));
|
||||
# undef FcConfigGetCurrent
|
||||
extern __typeof (FcConfigGetCurrent) FcConfigGetCurrent __attribute((alias("IA__FcConfigGetCurrent"), visibility("default")));
|
||||
# undef FcConfigUptoDate
|
||||
extern __typeof (FcConfigUptoDate) FcConfigUptoDate __attribute((alias("IA__FcConfigUptoDate"), visibility("default")));
|
||||
# undef FcConfigBuildFonts
|
||||
extern __typeof (FcConfigBuildFonts) FcConfigBuildFonts __attribute((alias("IA__FcConfigBuildFonts"), visibility("default")));
|
||||
# undef FcConfigGetFontDirs
|
||||
extern __typeof (FcConfigGetFontDirs) FcConfigGetFontDirs __attribute((alias("IA__FcConfigGetFontDirs"), visibility("default")));
|
||||
# undef FcConfigGetConfigDirs
|
||||
extern __typeof (FcConfigGetConfigDirs) FcConfigGetConfigDirs __attribute((alias("IA__FcConfigGetConfigDirs"), visibility("default")));
|
||||
# undef FcConfigGetConfigFiles
|
||||
extern __typeof (FcConfigGetConfigFiles) FcConfigGetConfigFiles __attribute((alias("IA__FcConfigGetConfigFiles"), visibility("default")));
|
||||
# undef FcConfigGetCache
|
||||
extern __typeof (FcConfigGetCache) FcConfigGetCache __attribute((alias("IA__FcConfigGetCache"), visibility("default")));
|
||||
# undef FcConfigGetBlanks
|
||||
extern __typeof (FcConfigGetBlanks) FcConfigGetBlanks __attribute((alias("IA__FcConfigGetBlanks"), visibility("default")));
|
||||
# undef FcConfigGetCacheDirs
|
||||
extern __typeof (FcConfigGetCacheDirs) FcConfigGetCacheDirs __attribute((alias("IA__FcConfigGetCacheDirs"), visibility("default")));
|
||||
# undef FcConfigGetRescanInterval
|
||||
extern __typeof (FcConfigGetRescanInterval) FcConfigGetRescanInterval __attribute((alias("IA__FcConfigGetRescanInterval"), visibility("default")));
|
||||
# undef FcConfigSetRescanInterval
|
||||
extern __typeof (FcConfigSetRescanInterval) FcConfigSetRescanInterval __attribute((alias("IA__FcConfigSetRescanInterval"), visibility("default")));
|
||||
# undef FcConfigGetFonts
|
||||
extern __typeof (FcConfigGetFonts) FcConfigGetFonts __attribute((alias("IA__FcConfigGetFonts"), visibility("default")));
|
||||
# undef FcConfigAppFontAddFile
|
||||
extern __typeof (FcConfigAppFontAddFile) FcConfigAppFontAddFile __attribute((alias("IA__FcConfigAppFontAddFile"), visibility("default")));
|
||||
# undef FcConfigAppFontAddDir
|
||||
extern __typeof (FcConfigAppFontAddDir) FcConfigAppFontAddDir __attribute((alias("IA__FcConfigAppFontAddDir"), visibility("default")));
|
||||
# undef FcConfigAppFontClear
|
||||
extern __typeof (FcConfigAppFontClear) FcConfigAppFontClear __attribute((alias("IA__FcConfigAppFontClear"), visibility("default")));
|
||||
# undef FcConfigSubstituteWithPat
|
||||
extern __typeof (FcConfigSubstituteWithPat) FcConfigSubstituteWithPat __attribute((alias("IA__FcConfigSubstituteWithPat"), visibility("default")));
|
||||
# undef FcConfigSubstitute
|
||||
extern __typeof (FcConfigSubstitute) FcConfigSubstitute __attribute((alias("IA__FcConfigSubstitute"), visibility("default")));
|
||||
# undef FcConfigGetSysRoot
|
||||
extern __typeof (FcConfigGetSysRoot) FcConfigGetSysRoot __attribute((alias("IA__FcConfigGetSysRoot"), visibility("default")));
|
||||
# undef FcConfigSetSysRoot
|
||||
extern __typeof (FcConfigSetSysRoot) FcConfigSetSysRoot __attribute((alias("IA__FcConfigSetSysRoot"), visibility("default")));
|
||||
#endif /* __fccfg__ */
|
||||
#ifdef __fccharset__
|
||||
# undef FcCharSetCreate
|
||||
extern __typeof (FcCharSetCreate) FcCharSetCreate __attribute((alias("IA__FcCharSetCreate"), visibility("default")));
|
||||
# undef FcCharSetNew
|
||||
extern __typeof (FcCharSetNew) FcCharSetNew __attribute((alias("IA__FcCharSetNew"), visibility("default")));
|
||||
# undef FcCharSetDestroy
|
||||
extern __typeof (FcCharSetDestroy) FcCharSetDestroy __attribute((alias("IA__FcCharSetDestroy"), visibility("default")));
|
||||
# undef FcCharSetAddChar
|
||||
extern __typeof (FcCharSetAddChar) FcCharSetAddChar __attribute((alias("IA__FcCharSetAddChar"), visibility("default")));
|
||||
# undef FcCharSetDelChar
|
||||
extern __typeof (FcCharSetDelChar) FcCharSetDelChar __attribute((alias("IA__FcCharSetDelChar"), visibility("default")));
|
||||
# undef FcCharSetCopy
|
||||
extern __typeof (FcCharSetCopy) FcCharSetCopy __attribute((alias("IA__FcCharSetCopy"), visibility("default")));
|
||||
# undef FcCharSetEqual
|
||||
extern __typeof (FcCharSetEqual) FcCharSetEqual __attribute((alias("IA__FcCharSetEqual"), visibility("default")));
|
||||
# undef FcCharSetIntersect
|
||||
extern __typeof (FcCharSetIntersect) FcCharSetIntersect __attribute((alias("IA__FcCharSetIntersect"), visibility("default")));
|
||||
# undef FcCharSetUnion
|
||||
extern __typeof (FcCharSetUnion) FcCharSetUnion __attribute((alias("IA__FcCharSetUnion"), visibility("default")));
|
||||
# undef FcCharSetSubtract
|
||||
extern __typeof (FcCharSetSubtract) FcCharSetSubtract __attribute((alias("IA__FcCharSetSubtract"), visibility("default")));
|
||||
# undef FcCharSetMerge
|
||||
extern __typeof (FcCharSetMerge) FcCharSetMerge __attribute((alias("IA__FcCharSetMerge"), visibility("default")));
|
||||
# undef FcCharSetHasChar
|
||||
extern __typeof (FcCharSetHasChar) FcCharSetHasChar __attribute((alias("IA__FcCharSetHasChar"), visibility("default")));
|
||||
# undef FcCharSetCount
|
||||
extern __typeof (FcCharSetCount) FcCharSetCount __attribute((alias("IA__FcCharSetCount"), visibility("default")));
|
||||
# undef FcCharSetIntersectCount
|
||||
extern __typeof (FcCharSetIntersectCount) FcCharSetIntersectCount __attribute((alias("IA__FcCharSetIntersectCount"), visibility("default")));
|
||||
# undef FcCharSetSubtractCount
|
||||
extern __typeof (FcCharSetSubtractCount) FcCharSetSubtractCount __attribute((alias("IA__FcCharSetSubtractCount"), visibility("default")));
|
||||
# undef FcCharSetIsSubset
|
||||
extern __typeof (FcCharSetIsSubset) FcCharSetIsSubset __attribute((alias("IA__FcCharSetIsSubset"), visibility("default")));
|
||||
# undef FcCharSetFirstPage
|
||||
extern __typeof (FcCharSetFirstPage) FcCharSetFirstPage __attribute((alias("IA__FcCharSetFirstPage"), visibility("default")));
|
||||
# undef FcCharSetNextPage
|
||||
extern __typeof (FcCharSetNextPage) FcCharSetNextPage __attribute((alias("IA__FcCharSetNextPage"), visibility("default")));
|
||||
# undef FcCharSetCoverage
|
||||
extern __typeof (FcCharSetCoverage) FcCharSetCoverage __attribute((alias("IA__FcCharSetCoverage"), visibility("default")));
|
||||
#endif /* __fccharset__ */
|
||||
#ifdef __fcdbg__
|
||||
# undef FcValuePrint
|
||||
extern __typeof (FcValuePrint) FcValuePrint __attribute((alias("IA__FcValuePrint"), visibility("default")));
|
||||
# undef FcPatternPrint
|
||||
extern __typeof (FcPatternPrint) FcPatternPrint __attribute((alias("IA__FcPatternPrint"), visibility("default")));
|
||||
# undef FcFontSetPrint
|
||||
extern __typeof (FcFontSetPrint) FcFontSetPrint __attribute((alias("IA__FcFontSetPrint"), visibility("default")));
|
||||
#endif /* __fcdbg__ */
|
||||
#ifdef __fcdefault__
|
||||
# undef FcGetDefaultLangs
|
||||
extern __typeof (FcGetDefaultLangs) FcGetDefaultLangs __attribute((alias("IA__FcGetDefaultLangs"), visibility("default")));
|
||||
# undef FcDefaultSubstitute
|
||||
extern __typeof (FcDefaultSubstitute) FcDefaultSubstitute __attribute((alias("IA__FcDefaultSubstitute"), visibility("default")));
|
||||
#endif /* __fcdefault__ */
|
||||
#ifdef __fcdir__
|
||||
# undef FcFileIsDir
|
||||
extern __typeof (FcFileIsDir) FcFileIsDir __attribute((alias("IA__FcFileIsDir"), visibility("default")));
|
||||
# undef FcFileScan
|
||||
extern __typeof (FcFileScan) FcFileScan __attribute((alias("IA__FcFileScan"), visibility("default")));
|
||||
# undef FcDirScan
|
||||
extern __typeof (FcDirScan) FcDirScan __attribute((alias("IA__FcDirScan"), visibility("default")));
|
||||
# undef FcDirSave
|
||||
extern __typeof (FcDirSave) FcDirSave __attribute((alias("IA__FcDirSave"), visibility("default")));
|
||||
#endif /* __fcdir__ */
|
||||
#ifdef __fccache__
|
||||
# undef FcDirCacheLoad
|
||||
extern __typeof (FcDirCacheLoad) FcDirCacheLoad __attribute((alias("IA__FcDirCacheLoad"), visibility("default")));
|
||||
#endif /* __fccache__ */
|
||||
#ifdef __fcdir__
|
||||
# undef FcDirCacheRescan
|
||||
extern __typeof (FcDirCacheRescan) FcDirCacheRescan __attribute((alias("IA__FcDirCacheRescan"), visibility("default")));
|
||||
# undef FcDirCacheRead
|
||||
extern __typeof (FcDirCacheRead) FcDirCacheRead __attribute((alias("IA__FcDirCacheRead"), visibility("default")));
|
||||
#endif /* __fcdir__ */
|
||||
#ifdef __fccache__
|
||||
# undef FcDirCacheLoadFile
|
||||
extern __typeof (FcDirCacheLoadFile) FcDirCacheLoadFile __attribute((alias("IA__FcDirCacheLoadFile"), visibility("default")));
|
||||
# undef FcDirCacheUnload
|
||||
extern __typeof (FcDirCacheUnload) FcDirCacheUnload __attribute((alias("IA__FcDirCacheUnload"), visibility("default")));
|
||||
#endif /* __fccache__ */
|
||||
#ifdef __fcfreetype__
|
||||
# undef FcFreeTypeQuery
|
||||
extern __typeof (FcFreeTypeQuery) FcFreeTypeQuery __attribute((alias("IA__FcFreeTypeQuery"), visibility("default")));
|
||||
#endif /* __fcfreetype__ */
|
||||
#ifdef __fcfs__
|
||||
# undef FcFontSetCreate
|
||||
extern __typeof (FcFontSetCreate) FcFontSetCreate __attribute((alias("IA__FcFontSetCreate"), visibility("default")));
|
||||
# undef FcFontSetDestroy
|
||||
extern __typeof (FcFontSetDestroy) FcFontSetDestroy __attribute((alias("IA__FcFontSetDestroy"), visibility("default")));
|
||||
# undef FcFontSetAdd
|
||||
extern __typeof (FcFontSetAdd) FcFontSetAdd __attribute((alias("IA__FcFontSetAdd"), visibility("default")));
|
||||
#endif /* __fcfs__ */
|
||||
#ifdef __fcinit__
|
||||
# undef FcInitLoadConfig
|
||||
extern __typeof (FcInitLoadConfig) FcInitLoadConfig __attribute((alias("IA__FcInitLoadConfig"), visibility("default")));
|
||||
# undef FcInitLoadConfigAndFonts
|
||||
extern __typeof (FcInitLoadConfigAndFonts) FcInitLoadConfigAndFonts __attribute((alias("IA__FcInitLoadConfigAndFonts"), visibility("default")));
|
||||
# undef FcInit
|
||||
extern __typeof (FcInit) FcInit __attribute((alias("IA__FcInit"), visibility("default")));
|
||||
# undef FcFini
|
||||
extern __typeof (FcFini) FcFini __attribute((alias("IA__FcFini"), visibility("default")));
|
||||
# undef FcGetVersion
|
||||
extern __typeof (FcGetVersion) FcGetVersion __attribute((alias("IA__FcGetVersion"), visibility("default")));
|
||||
# undef FcInitReinitialize
|
||||
extern __typeof (FcInitReinitialize) FcInitReinitialize __attribute((alias("IA__FcInitReinitialize"), visibility("default")));
|
||||
# undef FcInitBringUptoDate
|
||||
extern __typeof (FcInitBringUptoDate) FcInitBringUptoDate __attribute((alias("IA__FcInitBringUptoDate"), visibility("default")));
|
||||
#endif /* __fcinit__ */
|
||||
#ifdef __fclang__
|
||||
# undef FcGetLangs
|
||||
extern __typeof (FcGetLangs) FcGetLangs __attribute((alias("IA__FcGetLangs"), visibility("default")));
|
||||
# undef FcLangNormalize
|
||||
extern __typeof (FcLangNormalize) FcLangNormalize __attribute((alias("IA__FcLangNormalize"), visibility("default")));
|
||||
# undef FcLangGetCharSet
|
||||
extern __typeof (FcLangGetCharSet) FcLangGetCharSet __attribute((alias("IA__FcLangGetCharSet"), visibility("default")));
|
||||
# undef FcLangSetCreate
|
||||
extern __typeof (FcLangSetCreate) FcLangSetCreate __attribute((alias("IA__FcLangSetCreate"), visibility("default")));
|
||||
# undef FcLangSetDestroy
|
||||
extern __typeof (FcLangSetDestroy) FcLangSetDestroy __attribute((alias("IA__FcLangSetDestroy"), visibility("default")));
|
||||
# undef FcLangSetCopy
|
||||
extern __typeof (FcLangSetCopy) FcLangSetCopy __attribute((alias("IA__FcLangSetCopy"), visibility("default")));
|
||||
# undef FcLangSetAdd
|
||||
extern __typeof (FcLangSetAdd) FcLangSetAdd __attribute((alias("IA__FcLangSetAdd"), visibility("default")));
|
||||
# undef FcLangSetDel
|
||||
extern __typeof (FcLangSetDel) FcLangSetDel __attribute((alias("IA__FcLangSetDel"), visibility("default")));
|
||||
# undef FcLangSetHasLang
|
||||
extern __typeof (FcLangSetHasLang) FcLangSetHasLang __attribute((alias("IA__FcLangSetHasLang"), visibility("default")));
|
||||
# undef FcLangSetCompare
|
||||
extern __typeof (FcLangSetCompare) FcLangSetCompare __attribute((alias("IA__FcLangSetCompare"), visibility("default")));
|
||||
# undef FcLangSetContains
|
||||
extern __typeof (FcLangSetContains) FcLangSetContains __attribute((alias("IA__FcLangSetContains"), visibility("default")));
|
||||
# undef FcLangSetEqual
|
||||
extern __typeof (FcLangSetEqual) FcLangSetEqual __attribute((alias("IA__FcLangSetEqual"), visibility("default")));
|
||||
# undef FcLangSetHash
|
||||
extern __typeof (FcLangSetHash) FcLangSetHash __attribute((alias("IA__FcLangSetHash"), visibility("default")));
|
||||
# undef FcLangSetGetLangs
|
||||
extern __typeof (FcLangSetGetLangs) FcLangSetGetLangs __attribute((alias("IA__FcLangSetGetLangs"), visibility("default")));
|
||||
# undef FcLangSetUnion
|
||||
extern __typeof (FcLangSetUnion) FcLangSetUnion __attribute((alias("IA__FcLangSetUnion"), visibility("default")));
|
||||
# undef FcLangSetSubtract
|
||||
extern __typeof (FcLangSetSubtract) FcLangSetSubtract __attribute((alias("IA__FcLangSetSubtract"), visibility("default")));
|
||||
#endif /* __fclang__ */
|
||||
#ifdef __fclist__
|
||||
# undef FcObjectSetCreate
|
||||
extern __typeof (FcObjectSetCreate) FcObjectSetCreate __attribute((alias("IA__FcObjectSetCreate"), visibility("default")));
|
||||
# undef FcObjectSetAdd
|
||||
extern __typeof (FcObjectSetAdd) FcObjectSetAdd __attribute((alias("IA__FcObjectSetAdd"), visibility("default")));
|
||||
# undef FcObjectSetDestroy
|
||||
extern __typeof (FcObjectSetDestroy) FcObjectSetDestroy __attribute((alias("IA__FcObjectSetDestroy"), visibility("default")));
|
||||
# undef FcObjectSetVaBuild
|
||||
extern __typeof (FcObjectSetVaBuild) FcObjectSetVaBuild __attribute((alias("IA__FcObjectSetVaBuild"), visibility("default")));
|
||||
# undef FcObjectSetBuild
|
||||
extern __typeof (FcObjectSetBuild) FcObjectSetBuild __attribute((alias("IA__FcObjectSetBuild"), visibility("default")));
|
||||
# undef FcFontSetList
|
||||
extern __typeof (FcFontSetList) FcFontSetList __attribute((alias("IA__FcFontSetList"), visibility("default")));
|
||||
# undef FcFontList
|
||||
extern __typeof (FcFontList) FcFontList __attribute((alias("IA__FcFontList"), visibility("default")));
|
||||
#endif /* __fclist__ */
|
||||
#ifdef __fcatomic__
|
||||
# undef FcAtomicCreate
|
||||
extern __typeof (FcAtomicCreate) FcAtomicCreate __attribute((alias("IA__FcAtomicCreate"), visibility("default")));
|
||||
# undef FcAtomicLock
|
||||
extern __typeof (FcAtomicLock) FcAtomicLock __attribute((alias("IA__FcAtomicLock"), visibility("default")));
|
||||
# undef FcAtomicNewFile
|
||||
extern __typeof (FcAtomicNewFile) FcAtomicNewFile __attribute((alias("IA__FcAtomicNewFile"), visibility("default")));
|
||||
# undef FcAtomicOrigFile
|
||||
extern __typeof (FcAtomicOrigFile) FcAtomicOrigFile __attribute((alias("IA__FcAtomicOrigFile"), visibility("default")));
|
||||
# undef FcAtomicReplaceOrig
|
||||
extern __typeof (FcAtomicReplaceOrig) FcAtomicReplaceOrig __attribute((alias("IA__FcAtomicReplaceOrig"), visibility("default")));
|
||||
# undef FcAtomicDeleteNew
|
||||
extern __typeof (FcAtomicDeleteNew) FcAtomicDeleteNew __attribute((alias("IA__FcAtomicDeleteNew"), visibility("default")));
|
||||
# undef FcAtomicUnlock
|
||||
extern __typeof (FcAtomicUnlock) FcAtomicUnlock __attribute((alias("IA__FcAtomicUnlock"), visibility("default")));
|
||||
# undef FcAtomicDestroy
|
||||
extern __typeof (FcAtomicDestroy) FcAtomicDestroy __attribute((alias("IA__FcAtomicDestroy"), visibility("default")));
|
||||
#endif /* __fcatomic__ */
|
||||
#ifdef __fcmatch__
|
||||
# undef FcFontSetMatch
|
||||
extern __typeof (FcFontSetMatch) FcFontSetMatch __attribute((alias("IA__FcFontSetMatch"), visibility("default")));
|
||||
# undef FcFontMatch
|
||||
extern __typeof (FcFontMatch) FcFontMatch __attribute((alias("IA__FcFontMatch"), visibility("default")));
|
||||
# undef FcFontRenderPrepare
|
||||
extern __typeof (FcFontRenderPrepare) FcFontRenderPrepare __attribute((alias("IA__FcFontRenderPrepare"), visibility("default")));
|
||||
# undef FcFontSetSort
|
||||
extern __typeof (FcFontSetSort) FcFontSetSort __attribute((alias("IA__FcFontSetSort"), visibility("default")));
|
||||
# undef FcFontSort
|
||||
extern __typeof (FcFontSort) FcFontSort __attribute((alias("IA__FcFontSort"), visibility("default")));
|
||||
# undef FcFontSetSortDestroy
|
||||
extern __typeof (FcFontSetSortDestroy) FcFontSetSortDestroy __attribute((alias("IA__FcFontSetSortDestroy"), visibility("default")));
|
||||
#endif /* __fcmatch__ */
|
||||
#ifdef __fcmatrix__
|
||||
# undef FcMatrixCopy
|
||||
extern __typeof (FcMatrixCopy) FcMatrixCopy __attribute((alias("IA__FcMatrixCopy"), visibility("default")));
|
||||
# undef FcMatrixEqual
|
||||
extern __typeof (FcMatrixEqual) FcMatrixEqual __attribute((alias("IA__FcMatrixEqual"), visibility("default")));
|
||||
# undef FcMatrixMultiply
|
||||
extern __typeof (FcMatrixMultiply) FcMatrixMultiply __attribute((alias("IA__FcMatrixMultiply"), visibility("default")));
|
||||
# undef FcMatrixRotate
|
||||
extern __typeof (FcMatrixRotate) FcMatrixRotate __attribute((alias("IA__FcMatrixRotate"), visibility("default")));
|
||||
# undef FcMatrixScale
|
||||
extern __typeof (FcMatrixScale) FcMatrixScale __attribute((alias("IA__FcMatrixScale"), visibility("default")));
|
||||
# undef FcMatrixShear
|
||||
extern __typeof (FcMatrixShear) FcMatrixShear __attribute((alias("IA__FcMatrixShear"), visibility("default")));
|
||||
#endif /* __fcmatrix__ */
|
||||
#ifdef __fcname__
|
||||
# undef FcNameRegisterObjectTypes
|
||||
extern __typeof (FcNameRegisterObjectTypes) FcNameRegisterObjectTypes __attribute((alias("IA__FcNameRegisterObjectTypes"), visibility("default")));
|
||||
# undef FcNameUnregisterObjectTypes
|
||||
extern __typeof (FcNameUnregisterObjectTypes) FcNameUnregisterObjectTypes __attribute((alias("IA__FcNameUnregisterObjectTypes"), visibility("default")));
|
||||
# undef FcNameGetObjectType
|
||||
extern __typeof (FcNameGetObjectType) FcNameGetObjectType __attribute((alias("IA__FcNameGetObjectType"), visibility("default")));
|
||||
# undef FcNameRegisterConstants
|
||||
extern __typeof (FcNameRegisterConstants) FcNameRegisterConstants __attribute((alias("IA__FcNameRegisterConstants"), visibility("default")));
|
||||
# undef FcNameUnregisterConstants
|
||||
extern __typeof (FcNameUnregisterConstants) FcNameUnregisterConstants __attribute((alias("IA__FcNameUnregisterConstants"), visibility("default")));
|
||||
# undef FcNameGetConstant
|
||||
extern __typeof (FcNameGetConstant) FcNameGetConstant __attribute((alias("IA__FcNameGetConstant"), visibility("default")));
|
||||
# undef FcNameConstant
|
||||
extern __typeof (FcNameConstant) FcNameConstant __attribute((alias("IA__FcNameConstant"), visibility("default")));
|
||||
# undef FcNameParse
|
||||
extern __typeof (FcNameParse) FcNameParse __attribute((alias("IA__FcNameParse"), visibility("default")));
|
||||
# undef FcNameUnparse
|
||||
extern __typeof (FcNameUnparse) FcNameUnparse __attribute((alias("IA__FcNameUnparse"), visibility("default")));
|
||||
#endif /* __fcname__ */
|
||||
#ifdef __fcpat__
|
||||
# undef FcPatternCreate
|
||||
extern __typeof (FcPatternCreate) FcPatternCreate __attribute((alias("IA__FcPatternCreate"), visibility("default")));
|
||||
# undef FcPatternDuplicate
|
||||
extern __typeof (FcPatternDuplicate) FcPatternDuplicate __attribute((alias("IA__FcPatternDuplicate"), visibility("default")));
|
||||
# undef FcPatternReference
|
||||
extern __typeof (FcPatternReference) FcPatternReference __attribute((alias("IA__FcPatternReference"), visibility("default")));
|
||||
# undef FcPatternFilter
|
||||
extern __typeof (FcPatternFilter) FcPatternFilter __attribute((alias("IA__FcPatternFilter"), visibility("default")));
|
||||
# undef FcValueDestroy
|
||||
extern __typeof (FcValueDestroy) FcValueDestroy __attribute((alias("IA__FcValueDestroy"), visibility("default")));
|
||||
# undef FcValueEqual
|
||||
extern __typeof (FcValueEqual) FcValueEqual __attribute((alias("IA__FcValueEqual"), visibility("default")));
|
||||
# undef FcValueSave
|
||||
extern __typeof (FcValueSave) FcValueSave __attribute((alias("IA__FcValueSave"), visibility("default")));
|
||||
# undef FcPatternDestroy
|
||||
extern __typeof (FcPatternDestroy) FcPatternDestroy __attribute((alias("IA__FcPatternDestroy"), visibility("default")));
|
||||
# undef FcPatternEqual
|
||||
extern __typeof (FcPatternEqual) FcPatternEqual __attribute((alias("IA__FcPatternEqual"), visibility("default")));
|
||||
# undef FcPatternEqualSubset
|
||||
extern __typeof (FcPatternEqualSubset) FcPatternEqualSubset __attribute((alias("IA__FcPatternEqualSubset"), visibility("default")));
|
||||
# undef FcPatternHash
|
||||
extern __typeof (FcPatternHash) FcPatternHash __attribute((alias("IA__FcPatternHash"), visibility("default")));
|
||||
# undef FcPatternAdd
|
||||
extern __typeof (FcPatternAdd) FcPatternAdd __attribute((alias("IA__FcPatternAdd"), visibility("default")));
|
||||
# undef FcPatternAddWeak
|
||||
extern __typeof (FcPatternAddWeak) FcPatternAddWeak __attribute((alias("IA__FcPatternAddWeak"), visibility("default")));
|
||||
# undef FcPatternGet
|
||||
extern __typeof (FcPatternGet) FcPatternGet __attribute((alias("IA__FcPatternGet"), visibility("default")));
|
||||
# undef FcPatternDel
|
||||
extern __typeof (FcPatternDel) FcPatternDel __attribute((alias("IA__FcPatternDel"), visibility("default")));
|
||||
# undef FcPatternRemove
|
||||
extern __typeof (FcPatternRemove) FcPatternRemove __attribute((alias("IA__FcPatternRemove"), visibility("default")));
|
||||
# undef FcPatternAddInteger
|
||||
extern __typeof (FcPatternAddInteger) FcPatternAddInteger __attribute((alias("IA__FcPatternAddInteger"), visibility("default")));
|
||||
# undef FcPatternAddDouble
|
||||
extern __typeof (FcPatternAddDouble) FcPatternAddDouble __attribute((alias("IA__FcPatternAddDouble"), visibility("default")));
|
||||
# undef FcPatternAddString
|
||||
extern __typeof (FcPatternAddString) FcPatternAddString __attribute((alias("IA__FcPatternAddString"), visibility("default")));
|
||||
# undef FcPatternAddMatrix
|
||||
extern __typeof (FcPatternAddMatrix) FcPatternAddMatrix __attribute((alias("IA__FcPatternAddMatrix"), visibility("default")));
|
||||
# undef FcPatternAddCharSet
|
||||
extern __typeof (FcPatternAddCharSet) FcPatternAddCharSet __attribute((alias("IA__FcPatternAddCharSet"), visibility("default")));
|
||||
# undef FcPatternAddBool
|
||||
extern __typeof (FcPatternAddBool) FcPatternAddBool __attribute((alias("IA__FcPatternAddBool"), visibility("default")));
|
||||
# undef FcPatternAddLangSet
|
||||
extern __typeof (FcPatternAddLangSet) FcPatternAddLangSet __attribute((alias("IA__FcPatternAddLangSet"), visibility("default")));
|
||||
# undef FcPatternGetInteger
|
||||
extern __typeof (FcPatternGetInteger) FcPatternGetInteger __attribute((alias("IA__FcPatternGetInteger"), visibility("default")));
|
||||
# undef FcPatternGetDouble
|
||||
extern __typeof (FcPatternGetDouble) FcPatternGetDouble __attribute((alias("IA__FcPatternGetDouble"), visibility("default")));
|
||||
# undef FcPatternGetString
|
||||
extern __typeof (FcPatternGetString) FcPatternGetString __attribute((alias("IA__FcPatternGetString"), visibility("default")));
|
||||
# undef FcPatternGetMatrix
|
||||
extern __typeof (FcPatternGetMatrix) FcPatternGetMatrix __attribute((alias("IA__FcPatternGetMatrix"), visibility("default")));
|
||||
# undef FcPatternGetCharSet
|
||||
extern __typeof (FcPatternGetCharSet) FcPatternGetCharSet __attribute((alias("IA__FcPatternGetCharSet"), visibility("default")));
|
||||
# undef FcPatternGetBool
|
||||
extern __typeof (FcPatternGetBool) FcPatternGetBool __attribute((alias("IA__FcPatternGetBool"), visibility("default")));
|
||||
# undef FcPatternGetLangSet
|
||||
extern __typeof (FcPatternGetLangSet) FcPatternGetLangSet __attribute((alias("IA__FcPatternGetLangSet"), visibility("default")));
|
||||
# undef FcPatternVaBuild
|
||||
extern __typeof (FcPatternVaBuild) FcPatternVaBuild __attribute((alias("IA__FcPatternVaBuild"), visibility("default")));
|
||||
# undef FcPatternBuild
|
||||
extern __typeof (FcPatternBuild) FcPatternBuild __attribute((alias("IA__FcPatternBuild"), visibility("default")));
|
||||
#endif /* __fcpat__ */
|
||||
#ifdef __fcformat__
|
||||
# undef FcPatternFormat
|
||||
extern __typeof (FcPatternFormat) FcPatternFormat __attribute((alias("IA__FcPatternFormat"), visibility("default")));
|
||||
#endif /* __fcformat__ */
|
||||
#ifdef __fcstr__
|
||||
# undef FcStrCopy
|
||||
extern __typeof (FcStrCopy) FcStrCopy __attribute((alias("IA__FcStrCopy"), visibility("default")));
|
||||
# undef FcStrCopyFilename
|
||||
extern __typeof (FcStrCopyFilename) FcStrCopyFilename __attribute((alias("IA__FcStrCopyFilename"), visibility("default")));
|
||||
# undef FcStrPlus
|
||||
extern __typeof (FcStrPlus) FcStrPlus __attribute((alias("IA__FcStrPlus"), visibility("default")));
|
||||
# undef FcStrFree
|
||||
extern __typeof (FcStrFree) FcStrFree __attribute((alias("IA__FcStrFree"), visibility("default")));
|
||||
# undef FcStrDowncase
|
||||
extern __typeof (FcStrDowncase) FcStrDowncase __attribute((alias("IA__FcStrDowncase"), visibility("default")));
|
||||
# undef FcStrCmpIgnoreCase
|
||||
extern __typeof (FcStrCmpIgnoreCase) FcStrCmpIgnoreCase __attribute((alias("IA__FcStrCmpIgnoreCase"), visibility("default")));
|
||||
# undef FcStrCmp
|
||||
extern __typeof (FcStrCmp) FcStrCmp __attribute((alias("IA__FcStrCmp"), visibility("default")));
|
||||
# undef FcStrStrIgnoreCase
|
||||
extern __typeof (FcStrStrIgnoreCase) FcStrStrIgnoreCase __attribute((alias("IA__FcStrStrIgnoreCase"), visibility("default")));
|
||||
# undef FcStrStr
|
||||
extern __typeof (FcStrStr) FcStrStr __attribute((alias("IA__FcStrStr"), visibility("default")));
|
||||
# undef FcUtf8ToUcs4
|
||||
extern __typeof (FcUtf8ToUcs4) FcUtf8ToUcs4 __attribute((alias("IA__FcUtf8ToUcs4"), visibility("default")));
|
||||
# undef FcUtf8Len
|
||||
extern __typeof (FcUtf8Len) FcUtf8Len __attribute((alias("IA__FcUtf8Len"), visibility("default")));
|
||||
# undef FcUcs4ToUtf8
|
||||
extern __typeof (FcUcs4ToUtf8) FcUcs4ToUtf8 __attribute((alias("IA__FcUcs4ToUtf8"), visibility("default")));
|
||||
# undef FcUtf16ToUcs4
|
||||
extern __typeof (FcUtf16ToUcs4) FcUtf16ToUcs4 __attribute((alias("IA__FcUtf16ToUcs4"), visibility("default")));
|
||||
# undef FcUtf16Len
|
||||
extern __typeof (FcUtf16Len) FcUtf16Len __attribute((alias("IA__FcUtf16Len"), visibility("default")));
|
||||
# undef FcStrDirname
|
||||
extern __typeof (FcStrDirname) FcStrDirname __attribute((alias("IA__FcStrDirname"), visibility("default")));
|
||||
# undef FcStrBasename
|
||||
extern __typeof (FcStrBasename) FcStrBasename __attribute((alias("IA__FcStrBasename"), visibility("default")));
|
||||
# undef FcStrSetCreate
|
||||
extern __typeof (FcStrSetCreate) FcStrSetCreate __attribute((alias("IA__FcStrSetCreate"), visibility("default")));
|
||||
# undef FcStrSetMember
|
||||
extern __typeof (FcStrSetMember) FcStrSetMember __attribute((alias("IA__FcStrSetMember"), visibility("default")));
|
||||
# undef FcStrSetEqual
|
||||
extern __typeof (FcStrSetEqual) FcStrSetEqual __attribute((alias("IA__FcStrSetEqual"), visibility("default")));
|
||||
# undef FcStrSetAdd
|
||||
extern __typeof (FcStrSetAdd) FcStrSetAdd __attribute((alias("IA__FcStrSetAdd"), visibility("default")));
|
||||
# undef FcStrSetAddFilename
|
||||
extern __typeof (FcStrSetAddFilename) FcStrSetAddFilename __attribute((alias("IA__FcStrSetAddFilename"), visibility("default")));
|
||||
# undef FcStrSetDel
|
||||
extern __typeof (FcStrSetDel) FcStrSetDel __attribute((alias("IA__FcStrSetDel"), visibility("default")));
|
||||
# undef FcStrSetDestroy
|
||||
extern __typeof (FcStrSetDestroy) FcStrSetDestroy __attribute((alias("IA__FcStrSetDestroy"), visibility("default")));
|
||||
# undef FcStrListCreate
|
||||
extern __typeof (FcStrListCreate) FcStrListCreate __attribute((alias("IA__FcStrListCreate"), visibility("default")));
|
||||
# undef FcStrListFirst
|
||||
extern __typeof (FcStrListFirst) FcStrListFirst __attribute((alias("IA__FcStrListFirst"), visibility("default")));
|
||||
# undef FcStrListNext
|
||||
extern __typeof (FcStrListNext) FcStrListNext __attribute((alias("IA__FcStrListNext"), visibility("default")));
|
||||
# undef FcStrListDone
|
||||
extern __typeof (FcStrListDone) FcStrListDone __attribute((alias("IA__FcStrListDone"), visibility("default")));
|
||||
#endif /* __fcstr__ */
|
||||
#ifdef __fcxml__
|
||||
# undef FcConfigParseAndLoad
|
||||
extern __typeof (FcConfigParseAndLoad) FcConfigParseAndLoad __attribute((alias("IA__FcConfigParseAndLoad"), visibility("default")));
|
||||
#endif /* __fcxml__ */
|
||||
#ifdef __fccfg__
|
||||
# undef FcConfigGetRescanInverval
|
||||
extern __typeof (FcConfigGetRescanInverval) FcConfigGetRescanInverval __attribute((alias("IA__FcConfigGetRescanInverval"), visibility("default")));
|
||||
# undef FcConfigSetRescanInverval
|
||||
extern __typeof (FcConfigSetRescanInverval) FcConfigSetRescanInverval __attribute((alias("IA__FcConfigSetRescanInverval"), visibility("default")));
|
||||
#endif /* */
|
||||
#endif /* HAVE_GNUC_ATTRIBUTE */
|
||||
60
project/jni/fontconfig/src/fcarch.c
Normal file
60
project/jni/fontconfig/src/fcarch.c
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright © 2002 Keith Packard
|
||||
* Copyright © 2010 Behdad Esfahbod
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "fcint.h"
|
||||
#include "fcarch.h"
|
||||
|
||||
FC_ASSERT_STATIC (1 == sizeof (char));
|
||||
FC_ASSERT_STATIC (2 == sizeof (FcChar16));
|
||||
FC_ASSERT_STATIC (4 == sizeof (int));
|
||||
FC_ASSERT_STATIC (4 == sizeof (FcChar32));
|
||||
FC_ASSERT_STATIC (4 == sizeof (FcObject));
|
||||
FC_ASSERT_STATIC (4 == sizeof (FcValueBinding));
|
||||
FC_ASSERT_STATIC (8 == sizeof (FcAlign));
|
||||
FC_ASSERT_STATIC (0x20 == sizeof (FcCharLeaf));
|
||||
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (intptr_t));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcPatternEltPtr));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueListPtr));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (char *));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (struct FcPatternElt *));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcValueList *));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **));
|
||||
FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *));
|
||||
|
||||
FC_ASSERT_STATIC (0x08 + 1*FC_MAX(SIZEOF_VOID_P,ALIGNOF_DOUBLE) == sizeof (FcValue));
|
||||
FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
|
||||
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
|
||||
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
|
||||
FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
|
||||
|
||||
|
||||
int
|
||||
main (int argc FC_UNUSED, char **argv FC_UNUSED)
|
||||
{
|
||||
printf ("%s\n", FC_ARCHITECTURE);
|
||||
return 0;
|
||||
}
|
||||
76
project/jni/fontconfig/src/fcarch.h
Normal file
76
project/jni/fontconfig/src/fcarch.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright © 2006 Keith Packard
|
||||
* Copyright © 2010 Behdad Esfahbod
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#ifndef _FCARCH_H_
|
||||
#define _FCARCH_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Each unique machine architecture needs an entry in this file
|
||||
* So far the differences boil down to: endianness, 32 vs 64 bit pointers,
|
||||
* and on 32bit ones, whether double is aligned to one word or two words.
|
||||
* Those result in the 6 formats listed below.
|
||||
*
|
||||
* If any of the assertion errors in fcarch.c fail, you need to add a new
|
||||
* architecture. Contact the fontconfig mailing list in that case.
|
||||
*
|
||||
* name endianness pointer-size double-alignment
|
||||
*
|
||||
* le32d4 4321 4 4
|
||||
* le32d8 4321 4 8
|
||||
* le64 4321 8 8
|
||||
* be32d4 1234 4 4
|
||||
* be32d8 1234 4 8
|
||||
* be64 1234 8 8
|
||||
*/
|
||||
|
||||
#if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
|
||||
# define FC_ARCH_ENDIAN "le"
|
||||
#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
|
||||
# define FC_ARCH_ENDIAN "be"
|
||||
#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_PDP_ENDIAN
|
||||
# define FC_ARCH_ENDIAN "pe"
|
||||
#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN
|
||||
# define FC_ARCH_ENDIAN "be"
|
||||
#else
|
||||
# define FC_ARCH_ENDIAN "le"
|
||||
#endif
|
||||
|
||||
#if SIZEOF_VOID_P == 4
|
||||
# if ALIGNOF_DOUBLE == 4
|
||||
# define FC_ARCH_SIZE_ALIGN "32d4"
|
||||
# else /* ALIGNOF_DOUBLE != 4 */
|
||||
# define FC_ARCH_SIZE_ALIGN "32d8"
|
||||
# endif
|
||||
#else /* SIZEOF_VOID_P != 4 */
|
||||
# define FC_ARCH_SIZE_ALIGN "64"
|
||||
#endif
|
||||
|
||||
/* config.h might override this */
|
||||
#ifndef FC_ARCHITECTURE
|
||||
# define FC_ARCHITECTURE FC_ARCH_ENDIAN FC_ARCH_SIZE_ALIGN
|
||||
#endif
|
||||
|
||||
#endif /* _FCARCH_H_ */
|
||||
229
project/jni/fontconfig/src/fcatomic.c
Normal file
229
project/jni/fontconfig/src/fcatomic.c
Normal file
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* fontconfig/src/fcatomic.c
|
||||
*
|
||||
* Copyright © 2002 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* fcatomic.c
|
||||
*
|
||||
* Lock cache and configuration files for atomic update
|
||||
*
|
||||
* Uses only regular filesystem calls so it should
|
||||
* work even in the absense of functioning file locking
|
||||
*
|
||||
* On Unix, four files are used:
|
||||
* file - the data file accessed by other apps.
|
||||
* new - a new version of the data file while it's being written
|
||||
* lck - the lock file
|
||||
* tmp - a temporary file made unique with mkstemp
|
||||
*
|
||||
* Here's how it works:
|
||||
* Create 'tmp' and store our PID in it
|
||||
* Attempt to link it to 'lck'
|
||||
* Unlink 'tmp'
|
||||
* If the link succeeded, the lock is held
|
||||
*
|
||||
* On Windows, where there are no links, no tmp file is used, and lck
|
||||
* is a directory that's mkdir'ed. If the mkdir succeeds, the lock is
|
||||
* held.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#define mkdir(path,mode) _mkdir(path)
|
||||
#endif
|
||||
|
||||
#define NEW_NAME ".NEW"
|
||||
#define LCK_NAME ".LCK"
|
||||
#define TMP_NAME ".TMP-XXXXXX"
|
||||
|
||||
FcAtomic *
|
||||
FcAtomicCreate (const FcChar8 *file)
|
||||
{
|
||||
int file_len = strlen ((char *) file);
|
||||
int new_len = file_len + sizeof (NEW_NAME);
|
||||
int lck_len = file_len + sizeof (LCK_NAME);
|
||||
int tmp_len = file_len + sizeof (TMP_NAME);
|
||||
int total_len = (sizeof (FcAtomic) +
|
||||
file_len + 1 +
|
||||
new_len + 1 +
|
||||
lck_len + 1 +
|
||||
tmp_len + 1);
|
||||
FcAtomic *atomic = malloc (total_len);
|
||||
if (!atomic)
|
||||
return 0;
|
||||
|
||||
atomic->file = (FcChar8 *) (atomic + 1);
|
||||
strcpy ((char *) atomic->file, (char *) file);
|
||||
|
||||
atomic->new = atomic->file + file_len + 1;
|
||||
strcpy ((char *) atomic->new, (char *) file);
|
||||
strcat ((char *) atomic->new, NEW_NAME);
|
||||
|
||||
atomic->lck = atomic->new + new_len + 1;
|
||||
strcpy ((char *) atomic->lck, (char *) file);
|
||||
strcat ((char *) atomic->lck, LCK_NAME);
|
||||
|
||||
atomic->tmp = atomic->lck + lck_len + 1;
|
||||
|
||||
return atomic;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcAtomicLock (FcAtomic *atomic)
|
||||
{
|
||||
int ret;
|
||||
struct stat lck_stat;
|
||||
|
||||
#ifdef HAVE_LINK
|
||||
int fd = -1;
|
||||
FILE *f = 0;
|
||||
FcBool no_link = FcFalse;
|
||||
|
||||
strcpy ((char *) atomic->tmp, (char *) atomic->file);
|
||||
strcat ((char *) atomic->tmp, TMP_NAME);
|
||||
fd = FcMakeTempfile ((char *) atomic->tmp);
|
||||
if (fd < 0)
|
||||
return FcFalse;
|
||||
f = fdopen (fd, "w");
|
||||
if (!f)
|
||||
{
|
||||
close (fd);
|
||||
unlink ((char *) atomic->tmp);
|
||||
return FcFalse;
|
||||
}
|
||||
ret = fprintf (f, "%ld\n", (long)getpid());
|
||||
if (ret <= 0)
|
||||
{
|
||||
fclose (f);
|
||||
unlink ((char *) atomic->tmp);
|
||||
return FcFalse;
|
||||
}
|
||||
if (fclose (f) == EOF)
|
||||
{
|
||||
unlink ((char *) atomic->tmp);
|
||||
return FcFalse;
|
||||
}
|
||||
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
|
||||
if (ret < 0 && errno == EPERM)
|
||||
{
|
||||
/* the filesystem where atomic->lck points to may not supports
|
||||
* the hard link. so better try to fallback
|
||||
*/
|
||||
ret = mkdir ((char *) atomic->lck, 0600);
|
||||
no_link = FcTrue;
|
||||
}
|
||||
(void) unlink ((char *) atomic->tmp);
|
||||
#else
|
||||
ret = mkdir ((char *) atomic->lck, 0600);
|
||||
#endif
|
||||
if (ret < 0)
|
||||
{
|
||||
/*
|
||||
* If the file is around and old (> 10 minutes),
|
||||
* assume the lock is stale. This assumes that any
|
||||
* machines sharing the same filesystem will have clocks
|
||||
* reasonably close to each other.
|
||||
*/
|
||||
if (FcStat (atomic->lck, &lck_stat) >= 0)
|
||||
{
|
||||
time_t now = time (0);
|
||||
if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
|
||||
{
|
||||
#ifdef HAVE_LINK
|
||||
if (no_link)
|
||||
{
|
||||
if (rmdir ((char *) atomic->lck) == 0)
|
||||
return FcAtomicLock (atomic);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unlink ((char *) atomic->lck) == 0)
|
||||
return FcAtomicLock (atomic);
|
||||
}
|
||||
#else
|
||||
if (rmdir ((char *) atomic->lck) == 0)
|
||||
return FcAtomicLock (atomic);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return FcFalse;
|
||||
}
|
||||
(void) unlink ((char *) atomic->new);
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcAtomicNewFile (FcAtomic *atomic)
|
||||
{
|
||||
return atomic->new;
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcAtomicOrigFile (FcAtomic *atomic)
|
||||
{
|
||||
return atomic->file;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcAtomicReplaceOrig (FcAtomic *atomic)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
unlink ((const char *) atomic->file);
|
||||
#endif
|
||||
if (rename ((char *) atomic->new, (char *) atomic->file) < 0)
|
||||
return FcFalse;
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
void
|
||||
FcAtomicDeleteNew (FcAtomic *atomic)
|
||||
{
|
||||
unlink ((char *) atomic->new);
|
||||
}
|
||||
|
||||
void
|
||||
FcAtomicUnlock (FcAtomic *atomic)
|
||||
{
|
||||
#ifdef HAVE_LINK
|
||||
if (unlink ((char *) atomic->lck) == -1)
|
||||
rmdir ((char *) atomic->lck);
|
||||
#else
|
||||
rmdir ((char *) atomic->lck);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
FcAtomicDestroy (FcAtomic *atomic)
|
||||
{
|
||||
free (atomic);
|
||||
}
|
||||
#define __fcatomic__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcatomic__
|
||||
145
project/jni/fontconfig/src/fcatomic.h
Normal file
145
project/jni/fontconfig/src/fcatomic.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Mutex operations. Originally copied from HarfBuzz.
|
||||
*
|
||||
* Copyright © 2007 Chris Wilson
|
||||
* Copyright © 2009,2010 Red Hat, Inc.
|
||||
* Copyright © 2011,2012,2013 Google, Inc.
|
||||
*
|
||||
* Permission is hereby granted, without written agreement and without
|
||||
* license or royalty fees, to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose, provided that the
|
||||
* above copyright notice and the following two paragraphs appear in
|
||||
* all copies of this software.
|
||||
*
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Chris Wilson <chris@chris-wilson.co.uk>
|
||||
* Red Hat Author(s): Behdad Esfahbod
|
||||
* Google Author(s): Behdad Esfahbod
|
||||
*/
|
||||
|
||||
#ifndef _FCATOMIC_H_
|
||||
#define _FCATOMIC_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* atomic_int */
|
||||
|
||||
/* We need external help for these */
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
#include "fcwindows.h"
|
||||
|
||||
/* mingw32 does not have MemoryBarrier.
|
||||
* MemoryBarrier may be defined as a macro or a function.
|
||||
* Just make a failsafe version for ourselves. */
|
||||
#ifdef MemoryBarrier
|
||||
#define HBMemoryBarrier MemoryBarrier
|
||||
#else
|
||||
static inline void HBMemoryBarrier (void) {
|
||||
long dummy = 0;
|
||||
InterlockedExchange (&dummy, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef LONG fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) (HBMemoryBarrier (), (void *) *(P))
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(__APPLE__)
|
||||
|
||||
#include <libkern/OSAtomic.h>
|
||||
#ifdef __MAC_OS_X_MIN_REQUIRED
|
||||
#include <AvailabilityMacros.h>
|
||||
#elif defined(__IPHONE_OS_MIN_REQUIRED)
|
||||
#include <Availability.h>
|
||||
#endif
|
||||
|
||||
typedef int fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) (OSMemoryBarrier (), (void *) *(P))
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwapPtrBarrier ((void *) (O), (void *) (N), (void **) (P))
|
||||
#else
|
||||
#if __ppc64__ || __x86_64__
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
|
||||
#else
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) OSAtomicCompareAndSwap32Barrier ((int32_t) (O), (int32_t) (N), (int32_t*) (P))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
|
||||
|
||||
typedef int fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) __sync_fetch_and_add (&(AI), (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) (void *) (__sync_synchronize (), *(P))
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) __sync_bool_compare_and_swap ((P), (O), (N))
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(HAVE_SOLARIS_ATOMIC_OPS)
|
||||
|
||||
#include <atomic.h>
|
||||
#include <mbarrier.h>
|
||||
|
||||
typedef unsigned int fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P))
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) ( ({__machine_rw_barrier ();}), atomic_cas_ptr ((P), (O), (N)) == (void *) (O) ? FcTrue : FcFalse)
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT)
|
||||
|
||||
#define FC_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */
|
||||
typedef volatile int fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) (((AI) += (V)) - (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) ((void *) *(P))
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), FcTrue) : FcFalse)
|
||||
|
||||
|
||||
#else /* FC_NO_MT */
|
||||
|
||||
typedef int fc_atomic_int_t;
|
||||
#define fc_atomic_int_add(AI, V) (((AI) += (V)) - (V))
|
||||
|
||||
#define fc_atomic_ptr_get(P) ((void *) *(P))
|
||||
#define fc_atomic_ptr_cmpexch(P,O,N) (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), FcTrue) : FcFalse)
|
||||
|
||||
#endif
|
||||
|
||||
/* reference count */
|
||||
#define FC_REF_CONSTANT_VALUE ((fc_atomic_int_t) -1)
|
||||
#define FC_REF_CONSTANT {FC_REF_CONSTANT_VALUE}
|
||||
typedef struct _FcRef { fc_atomic_int_t count; } FcRef;
|
||||
static inline void FcRefInit (FcRef *r, int v) { r->count = v; }
|
||||
static inline int FcRefInc (FcRef *r) { return fc_atomic_int_add (r->count, +1); }
|
||||
static inline int FcRefDec (FcRef *r) { return fc_atomic_int_add (r->count, -1); }
|
||||
static inline int FcRefAdd (FcRef *r, int v) { return fc_atomic_int_add (r->count, v); }
|
||||
static inline void FcRefSetConst (FcRef *r) { r->count = FC_REF_CONSTANT_VALUE; }
|
||||
static inline FcBool FcRefIsConst (const FcRef *r) { return r->count == FC_REF_CONSTANT_VALUE; }
|
||||
|
||||
#endif /* _FCATOMIC_H_ */
|
||||
87
project/jni/fontconfig/src/fcblanks.c
Normal file
87
project/jni/fontconfig/src/fcblanks.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* fontconfig/src/fcblanks.c
|
||||
*
|
||||
* Copyright © 2002 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
|
||||
FcBlanks *
|
||||
FcBlanksCreate (void)
|
||||
{
|
||||
FcBlanks *b;
|
||||
|
||||
b = malloc (sizeof (FcBlanks));
|
||||
if (!b)
|
||||
return 0;
|
||||
b->nblank = 0;
|
||||
b->sblank = 0;
|
||||
b->blanks = 0;
|
||||
return b;
|
||||
}
|
||||
|
||||
void
|
||||
FcBlanksDestroy (FcBlanks *b)
|
||||
{
|
||||
if (b->blanks)
|
||||
free (b->blanks);
|
||||
free (b);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4)
|
||||
{
|
||||
FcChar32 *c;
|
||||
int sblank;
|
||||
|
||||
for (sblank = 0; sblank < b->nblank; sblank++)
|
||||
if (b->blanks[sblank] == ucs4)
|
||||
return FcTrue;
|
||||
|
||||
if (b->nblank == b->sblank)
|
||||
{
|
||||
sblank = b->sblank + 32;
|
||||
if (b->blanks)
|
||||
c = (FcChar32 *) realloc (b->blanks, sblank * sizeof (FcChar32));
|
||||
else
|
||||
c = (FcChar32 *) malloc (sblank * sizeof (FcChar32));
|
||||
if (!c)
|
||||
return FcFalse;
|
||||
b->sblank = sblank;
|
||||
b->blanks = c;
|
||||
}
|
||||
b->blanks[b->nblank++] = ucs4;
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < b->nblank; i++)
|
||||
if (b->blanks[i] == ucs4)
|
||||
return FcTrue;
|
||||
return FcFalse;
|
||||
}
|
||||
#define __fcblanks__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcblanks__
|
||||
1478
project/jni/fontconfig/src/fccache.c
Normal file
1478
project/jni/fontconfig/src/fccache.c
Normal file
File diff suppressed because it is too large
Load Diff
2352
project/jni/fontconfig/src/fccfg.c
Normal file
2352
project/jni/fontconfig/src/fccfg.c
Normal file
File diff suppressed because it is too large
Load Diff
1434
project/jni/fontconfig/src/fccharset.c
Normal file
1434
project/jni/fontconfig/src/fccharset.c
Normal file
File diff suppressed because it is too large
Load Diff
257
project/jni/fontconfig/src/fccompat.c
Normal file
257
project/jni/fontconfig/src/fccompat.c
Normal file
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* fontconfig/src/fccompat.c
|
||||
*
|
||||
* Copyright © 2012 Red Hat, Inc.
|
||||
*
|
||||
* Author(s):
|
||||
* Akira TAGOH
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
|
||||
#include <errno.h>
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#if HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef O_CLOEXEC
|
||||
#define FC_O_CLOEXEC O_CLOEXEC
|
||||
#else
|
||||
#define FC_O_CLOEXEC 0
|
||||
#endif
|
||||
#ifdef O_LARGEFILE
|
||||
#define FC_O_LARGEFILE O_LARGEFILE
|
||||
#else
|
||||
#define FC_O_LARGEFILE 0
|
||||
#endif
|
||||
#ifdef O_BINARY
|
||||
#define FC_O_BINARY O_BINARY
|
||||
#else
|
||||
#define FC_O_BINARY 0
|
||||
#endif
|
||||
#ifdef O_TEMPORARY
|
||||
#define FC_O_TEMPORARY O_TEMPORARY
|
||||
#else
|
||||
#define FC_O_TEMPORARY 0
|
||||
#endif
|
||||
#ifdef O_NOINHERIT
|
||||
#define FC_O_NOINHERIT O_NOINHERIT
|
||||
#else
|
||||
#define FC_O_NOINHERIT 0
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_MKOSTEMP) && !defined(HAVE_MKSTEMP) && !defined(HAVE__MKTEMP_S)
|
||||
static int
|
||||
mkstemp (char *template)
|
||||
{
|
||||
static const char s[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
int fd, i;
|
||||
size_t l;
|
||||
|
||||
if (template == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
l = strlen (template);
|
||||
if (l < 6 || strcmp (&template[l - 6], "XXXXXX") != 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
do
|
||||
{
|
||||
errno = 0;
|
||||
for (i = l - 6; i < l; i++)
|
||||
{
|
||||
int r = FcRandom ();
|
||||
template[i] = s[r % 62];
|
||||
}
|
||||
fd = FcOpen (template, FC_O_BINARY | O_CREAT | O_EXCL | FC_O_TEMPORARY | FC_O_NOINHERIT | O_RDWR, 0600);
|
||||
} while (fd < 0 && errno == EEXIST);
|
||||
if (fd >= 0)
|
||||
errno = 0;
|
||||
|
||||
return fd;
|
||||
}
|
||||
#define HAVE_MKSTEMP 1
|
||||
#endif
|
||||
|
||||
int
|
||||
FcOpen(const char *pathname, int flags, ...)
|
||||
{
|
||||
int fd = -1;
|
||||
|
||||
if (flags & O_CREAT)
|
||||
{
|
||||
va_list ap;
|
||||
mode_t mode;
|
||||
|
||||
va_start(ap, flags);
|
||||
mode = (mode_t) va_arg(ap, int);
|
||||
va_end(ap);
|
||||
|
||||
fd = open(pathname, flags | FC_O_CLOEXEC | FC_O_LARGEFILE, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = open(pathname, flags | FC_O_CLOEXEC | FC_O_LARGEFILE);
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
int
|
||||
FcMakeTempfile (char *template)
|
||||
{
|
||||
int fd = -1;
|
||||
|
||||
#if HAVE_MKOSTEMP
|
||||
fd = mkostemp (template, FC_O_CLOEXEC);
|
||||
#elif HAVE_MKSTEMP
|
||||
fd = mkstemp (template);
|
||||
# ifdef F_DUPFD_CLOEXEC
|
||||
if (fd != -1)
|
||||
{
|
||||
int newfd = fcntl(fd, F_DUPFD_CLOEXEC, STDIN_FILENO);
|
||||
|
||||
close(fd);
|
||||
fd = newfd;
|
||||
}
|
||||
# elif defined(FD_CLOEXEC)
|
||||
if (fd != -1)
|
||||
{
|
||||
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
|
||||
}
|
||||
# endif
|
||||
#elif HAVE__MKTEMP_S
|
||||
if (_mktemp_s(template, strlen(template) + 1) != 0)
|
||||
return -1;
|
||||
fd = FcOpen(template, O_RDWR | O_EXCL | O_CREAT, 0600);
|
||||
#endif
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
int32_t
|
||||
FcRandom(void)
|
||||
{
|
||||
int32_t result;
|
||||
|
||||
#if HAVE_RANDOM_R
|
||||
static struct random_data fcrandbuf;
|
||||
static char statebuf[256];
|
||||
static FcBool initialized = FcFalse;
|
||||
#ifdef _AIX
|
||||
static char *retval;
|
||||
long res;
|
||||
#endif
|
||||
|
||||
if (initialized != FcTrue)
|
||||
{
|
||||
#ifdef _AIX
|
||||
initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf);
|
||||
#else
|
||||
initstate_r (time (NULL), statebuf, 256, &fcrandbuf);
|
||||
#endif
|
||||
initialized = FcTrue;
|
||||
}
|
||||
|
||||
#ifdef _AIX
|
||||
random_r (&res, &fcrandbuf);
|
||||
result = (int32_t)res;
|
||||
#else
|
||||
random_r (&fcrandbuf, &result);
|
||||
#endif
|
||||
#elif HAVE_RANDOM
|
||||
static char statebuf[256];
|
||||
char *state;
|
||||
static FcBool initialized = FcFalse;
|
||||
|
||||
if (initialized != FcTrue)
|
||||
{
|
||||
state = initstate (time (NULL), statebuf, 256);
|
||||
initialized = FcTrue;
|
||||
}
|
||||
else
|
||||
state = setstate (statebuf);
|
||||
|
||||
result = random ();
|
||||
|
||||
setstate (state);
|
||||
#elif HAVE_LRAND48
|
||||
result = lrand48 ();
|
||||
#elif HAVE_RAND_R
|
||||
static unsigned int seed = time (NULL);
|
||||
|
||||
result = rand_r (&seed);
|
||||
#elif HAVE_RAND
|
||||
static FcBool initialized = FcFalse;
|
||||
|
||||
if (initialized != FcTrue)
|
||||
{
|
||||
srand (time (NULL));
|
||||
initialized = FcTrue;
|
||||
}
|
||||
result = rand ();
|
||||
#else
|
||||
# error no random number generator function available.
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#define mkdir(path,mode) _mkdir(path)
|
||||
#endif
|
||||
|
||||
FcBool
|
||||
FcMakeDirectory (const FcChar8 *dir)
|
||||
{
|
||||
FcChar8 *parent;
|
||||
FcBool ret;
|
||||
|
||||
if (strlen ((char *) dir) == 0)
|
||||
return FcFalse;
|
||||
|
||||
parent = FcStrDirname (dir);
|
||||
if (!parent)
|
||||
return FcFalse;
|
||||
if (access ((char *) parent, F_OK) == 0)
|
||||
ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0;
|
||||
else if (access ((char *) parent, F_OK) == -1)
|
||||
ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0;
|
||||
else
|
||||
ret = FcFalse;
|
||||
FcStrFree (parent);
|
||||
return ret;
|
||||
}
|
||||
499
project/jni/fontconfig/src/fcdbg.c
Normal file
499
project/jni/fontconfig/src/fcdbg.c
Normal file
@@ -0,0 +1,499 @@
|
||||
/*
|
||||
* fontconfig/src/fcdbg.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void
|
||||
_FcValuePrintFile (FILE *f, const FcValue v)
|
||||
{
|
||||
switch (v.type) {
|
||||
case FcTypeUnknown:
|
||||
fprintf (f, "<unknown>");
|
||||
break;
|
||||
case FcTypeVoid:
|
||||
fprintf (f, "<void>");
|
||||
break;
|
||||
case FcTypeInteger:
|
||||
fprintf (f, "%d(i)", v.u.i);
|
||||
break;
|
||||
case FcTypeDouble:
|
||||
fprintf (f, "%g(f)", v.u.d);
|
||||
break;
|
||||
case FcTypeString:
|
||||
fprintf (f, "\"%s\"", v.u.s);
|
||||
break;
|
||||
case FcTypeBool:
|
||||
fprintf (f, "%s", v.u.b ? "True" : "False");
|
||||
break;
|
||||
case FcTypeMatrix:
|
||||
fprintf (f, "[%g %g; %g %g]", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
|
||||
break;
|
||||
case FcTypeCharSet: /* XXX */
|
||||
if (f == stdout)
|
||||
FcCharSetPrint (v.u.c);
|
||||
break;
|
||||
case FcTypeLangSet:
|
||||
FcLangSetPrint (v.u.l);
|
||||
break;
|
||||
case FcTypeFTFace:
|
||||
fprintf (f, "face");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcValuePrintFile (FILE *f, const FcValue v)
|
||||
{
|
||||
fprintf (f, " ");
|
||||
_FcValuePrintFile (f, v);
|
||||
}
|
||||
|
||||
void
|
||||
FcValuePrint (const FcValue v)
|
||||
{
|
||||
printf (" ");
|
||||
_FcValuePrintFile (stdout, v);
|
||||
}
|
||||
|
||||
void
|
||||
FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark)
|
||||
{
|
||||
if (show_pos_mark)
|
||||
printf (" [marker] ");
|
||||
else
|
||||
printf (" ");
|
||||
_FcValuePrintFile (stdout, v);
|
||||
}
|
||||
|
||||
static void
|
||||
FcValueBindingPrint (const FcValueListPtr l)
|
||||
{
|
||||
switch (l->binding) {
|
||||
case FcValueBindingWeak:
|
||||
printf ("(w)");
|
||||
break;
|
||||
case FcValueBindingStrong:
|
||||
printf ("(s)");
|
||||
break;
|
||||
case FcValueBindingSame:
|
||||
printf ("(=)");
|
||||
break;
|
||||
default:
|
||||
/* shouldn't be reached */
|
||||
printf ("(?)");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos)
|
||||
{
|
||||
for (; l != NULL; l = FcValueListNext(l))
|
||||
{
|
||||
FcValuePrintWithPosition (FcValueCanonicalize (&l->value), pos != NULL && l == pos);
|
||||
FcValueBindingPrint (l);
|
||||
}
|
||||
if (!pos)
|
||||
printf (" [marker]");
|
||||
}
|
||||
|
||||
void
|
||||
FcValueListPrint (FcValueListPtr l)
|
||||
{
|
||||
for (; l != NULL; l = FcValueListNext(l))
|
||||
{
|
||||
FcValuePrint (FcValueCanonicalize (&l->value));
|
||||
FcValueBindingPrint (l);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcLangSetPrint (const FcLangSet *ls)
|
||||
{
|
||||
FcStrBuf buf;
|
||||
FcChar8 init_buf[1024];
|
||||
|
||||
FcStrBufInit (&buf, init_buf, sizeof (init_buf));
|
||||
if (FcNameUnparseLangSet (&buf, ls) && FcStrBufChar (&buf,'\0'))
|
||||
printf ("%s", buf.buf);
|
||||
else
|
||||
printf ("langset (alloc error)");
|
||||
FcStrBufDestroy (&buf);
|
||||
}
|
||||
|
||||
void
|
||||
FcCharSetPrint (const FcCharSet *c)
|
||||
{
|
||||
int i, j;
|
||||
intptr_t *leaves = FcCharSetLeaves (c);
|
||||
FcChar16 *numbers = FcCharSetNumbers (c);
|
||||
|
||||
#if 0
|
||||
printf ("CharSet 0x%x\n", (intptr_t) c);
|
||||
printf ("Leaves: +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves);
|
||||
printf ("Numbers: +%d = 0x%x\n", c->numbers_offset, (intptr_t) numbers);
|
||||
|
||||
for (i = 0; i < c->num; i++)
|
||||
{
|
||||
printf ("Page %d: %04x +%d = 0x%x\n",
|
||||
i, numbers[i], leaves[i],
|
||||
(intptr_t) FcOffsetToPtr (leaves, leaves[i], FcCharLeaf));
|
||||
}
|
||||
#endif
|
||||
|
||||
printf ("\n");
|
||||
for (i = 0; i < c->num; i++)
|
||||
{
|
||||
intptr_t leaf_offset = leaves[i];
|
||||
FcCharLeaf *leaf = FcOffsetToPtr (leaves, leaf_offset, FcCharLeaf);
|
||||
|
||||
printf ("\t");
|
||||
printf ("%04x:", numbers[i]);
|
||||
for (j = 0; j < 256/32; j++)
|
||||
printf (" %08x", leaf->map[j]);
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcPatternPrint (const FcPattern *p)
|
||||
{
|
||||
int i;
|
||||
FcPatternElt *e;
|
||||
|
||||
if (!p)
|
||||
{
|
||||
printf ("Null pattern\n");
|
||||
return;
|
||||
}
|
||||
printf ("Pattern has %d elts (size %d)\n", p->num, p->size);
|
||||
for (i = 0; i < p->num; i++)
|
||||
{
|
||||
e = &FcPatternElts(p)[i];
|
||||
printf ("\t%s:", FcObjectName(e->object));
|
||||
FcValueListPrint (FcPatternEltValues(e));
|
||||
printf ("\n");
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
#define FcOpFlagsPrint(_o_) \
|
||||
{ \
|
||||
int f = FC_OP_GET_FLAGS (_o_); \
|
||||
if (f & FcOpFlagIgnoreBlanks) \
|
||||
printf ("(ignore blanks)"); \
|
||||
}
|
||||
|
||||
void
|
||||
FcOpPrint (FcOp op_)
|
||||
{
|
||||
FcOp op = FC_OP_GET_OP (op_);
|
||||
|
||||
switch (op) {
|
||||
case FcOpInteger: printf ("Integer"); break;
|
||||
case FcOpDouble: printf ("Double"); break;
|
||||
case FcOpString: printf ("String"); break;
|
||||
case FcOpMatrix: printf ("Matrix"); break;
|
||||
case FcOpRange: printf ("Range"); break;
|
||||
case FcOpBool: printf ("Bool"); break;
|
||||
case FcOpCharSet: printf ("CharSet"); break;
|
||||
case FcOpLangSet: printf ("LangSet"); break;
|
||||
case FcOpField: printf ("Field"); break;
|
||||
case FcOpConst: printf ("Const"); break;
|
||||
case FcOpAssign: printf ("Assign"); break;
|
||||
case FcOpAssignReplace: printf ("AssignReplace"); break;
|
||||
case FcOpPrepend: printf ("Prepend"); break;
|
||||
case FcOpPrependFirst: printf ("PrependFirst"); break;
|
||||
case FcOpAppend: printf ("Append"); break;
|
||||
case FcOpAppendLast: printf ("AppendLast"); break;
|
||||
case FcOpDelete: printf ("Delete"); break;
|
||||
case FcOpDeleteAll: printf ("DeleteAll"); break;
|
||||
case FcOpQuest: printf ("Quest"); break;
|
||||
case FcOpOr: printf ("Or"); break;
|
||||
case FcOpAnd: printf ("And"); break;
|
||||
case FcOpEqual: printf ("Equal"); FcOpFlagsPrint (op_); break;
|
||||
case FcOpNotEqual: printf ("NotEqual"); FcOpFlagsPrint (op_); break;
|
||||
case FcOpLess: printf ("Less"); break;
|
||||
case FcOpLessEqual: printf ("LessEqual"); break;
|
||||
case FcOpMore: printf ("More"); break;
|
||||
case FcOpMoreEqual: printf ("MoreEqual"); break;
|
||||
case FcOpContains: printf ("Contains"); break;
|
||||
case FcOpNotContains: printf ("NotContains"); break;
|
||||
case FcOpPlus: printf ("Plus"); break;
|
||||
case FcOpMinus: printf ("Minus"); break;
|
||||
case FcOpTimes: printf ("Times"); break;
|
||||
case FcOpDivide: printf ("Divide"); break;
|
||||
case FcOpNot: printf ("Not"); break;
|
||||
case FcOpNil: printf ("Nil"); break;
|
||||
case FcOpComma: printf ("Comma"); break;
|
||||
case FcOpFloor: printf ("Floor"); break;
|
||||
case FcOpCeil: printf ("Ceil"); break;
|
||||
case FcOpRound: printf ("Round"); break;
|
||||
case FcOpTrunc: printf ("Trunc"); break;
|
||||
case FcOpListing: printf ("Listing"); FcOpFlagsPrint (op_); break;
|
||||
case FcOpInvalid: printf ("Invalid"); break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcExprPrint (const FcExpr *expr)
|
||||
{
|
||||
if (!expr) printf ("none");
|
||||
else switch (FC_OP_GET_OP (expr->op)) {
|
||||
case FcOpInteger: printf ("%d", expr->u.ival); break;
|
||||
case FcOpDouble: printf ("%g", expr->u.dval); break;
|
||||
case FcOpString: printf ("\"%s\"", expr->u.sval); break;
|
||||
case FcOpMatrix:
|
||||
printf ("[");
|
||||
FcExprPrint (expr->u.mexpr->xx);
|
||||
printf (" ");
|
||||
FcExprPrint (expr->u.mexpr->xy);
|
||||
printf ("; ");
|
||||
FcExprPrint (expr->u.mexpr->yx);
|
||||
printf (" ");
|
||||
FcExprPrint (expr->u.mexpr->yy);
|
||||
printf ("]");
|
||||
break;
|
||||
case FcOpRange: break;
|
||||
case FcOpBool: printf ("%s", expr->u.bval ? "true" : "false"); break;
|
||||
case FcOpCharSet: printf ("charset\n"); break;
|
||||
case FcOpLangSet:
|
||||
printf ("langset:");
|
||||
FcLangSetPrint(expr->u.lval);
|
||||
printf ("\n");
|
||||
break;
|
||||
case FcOpNil: printf ("nil\n"); break;
|
||||
case FcOpField: printf ("%s ", FcObjectName(expr->u.name.object));
|
||||
switch ((int) expr->u.name.kind) {
|
||||
case FcMatchPattern:
|
||||
printf ("(pattern) ");
|
||||
break;
|
||||
case FcMatchFont:
|
||||
printf ("(font) ");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FcOpConst: printf ("%s", expr->u.constant); break;
|
||||
case FcOpQuest:
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
printf (" quest ");
|
||||
FcExprPrint (expr->u.tree.right->u.tree.left);
|
||||
printf (" colon ");
|
||||
FcExprPrint (expr->u.tree.right->u.tree.right);
|
||||
break;
|
||||
case FcOpAssign:
|
||||
case FcOpAssignReplace:
|
||||
case FcOpPrependFirst:
|
||||
case FcOpPrepend:
|
||||
case FcOpAppend:
|
||||
case FcOpAppendLast:
|
||||
case FcOpOr:
|
||||
case FcOpAnd:
|
||||
case FcOpEqual:
|
||||
case FcOpNotEqual:
|
||||
case FcOpLess:
|
||||
case FcOpLessEqual:
|
||||
case FcOpMore:
|
||||
case FcOpMoreEqual:
|
||||
case FcOpContains:
|
||||
case FcOpListing:
|
||||
case FcOpNotContains:
|
||||
case FcOpPlus:
|
||||
case FcOpMinus:
|
||||
case FcOpTimes:
|
||||
case FcOpDivide:
|
||||
case FcOpComma:
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
printf (" ");
|
||||
switch (FC_OP_GET_OP (expr->op)) {
|
||||
case FcOpAssign: printf ("Assign"); break;
|
||||
case FcOpAssignReplace: printf ("AssignReplace"); break;
|
||||
case FcOpPrependFirst: printf ("PrependFirst"); break;
|
||||
case FcOpPrepend: printf ("Prepend"); break;
|
||||
case FcOpAppend: printf ("Append"); break;
|
||||
case FcOpAppendLast: printf ("AppendLast"); break;
|
||||
case FcOpOr: printf ("Or"); break;
|
||||
case FcOpAnd: printf ("And"); break;
|
||||
case FcOpEqual: printf ("Equal"); FcOpFlagsPrint (expr->op); break;
|
||||
case FcOpNotEqual: printf ("NotEqual"); FcOpFlagsPrint (expr->op); break;
|
||||
case FcOpLess: printf ("Less"); break;
|
||||
case FcOpLessEqual: printf ("LessEqual"); break;
|
||||
case FcOpMore: printf ("More"); break;
|
||||
case FcOpMoreEqual: printf ("MoreEqual"); break;
|
||||
case FcOpContains: printf ("Contains"); break;
|
||||
case FcOpListing: printf ("Listing"); FcOpFlagsPrint (expr->op); break;
|
||||
case FcOpNotContains: printf ("NotContains"); break;
|
||||
case FcOpPlus: printf ("Plus"); break;
|
||||
case FcOpMinus: printf ("Minus"); break;
|
||||
case FcOpTimes: printf ("Times"); break;
|
||||
case FcOpDivide: printf ("Divide"); break;
|
||||
case FcOpComma: printf ("Comma"); break;
|
||||
default: break;
|
||||
}
|
||||
printf (" ");
|
||||
FcExprPrint (expr->u.tree.right);
|
||||
break;
|
||||
case FcOpNot:
|
||||
printf ("Not ");
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
break;
|
||||
case FcOpFloor:
|
||||
printf ("Floor ");
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
break;
|
||||
case FcOpCeil:
|
||||
printf ("Ceil ");
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
break;
|
||||
case FcOpRound:
|
||||
printf ("Round ");
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
break;
|
||||
case FcOpTrunc:
|
||||
printf ("Trunc ");
|
||||
FcExprPrint (expr->u.tree.left);
|
||||
break;
|
||||
case FcOpInvalid: printf ("Invalid"); break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcTestPrint (const FcTest *test)
|
||||
{
|
||||
switch (test->kind) {
|
||||
case FcMatchPattern:
|
||||
printf ("pattern ");
|
||||
break;
|
||||
case FcMatchFont:
|
||||
printf ("font ");
|
||||
break;
|
||||
case FcMatchScan:
|
||||
printf ("scan ");
|
||||
break;
|
||||
}
|
||||
switch (test->qual) {
|
||||
case FcQualAny:
|
||||
printf ("any ");
|
||||
break;
|
||||
case FcQualAll:
|
||||
printf ("all ");
|
||||
break;
|
||||
case FcQualFirst:
|
||||
printf ("first ");
|
||||
break;
|
||||
case FcQualNotFirst:
|
||||
printf ("not_first ");
|
||||
break;
|
||||
}
|
||||
printf ("%s ", FcObjectName (test->object));
|
||||
FcOpPrint (test->op);
|
||||
printf (" ");
|
||||
FcExprPrint (test->expr);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
void
|
||||
FcEditPrint (const FcEdit *edit)
|
||||
{
|
||||
printf ("Edit %s ", FcObjectName (edit->object));
|
||||
FcOpPrint (edit->op);
|
||||
printf (" ");
|
||||
FcExprPrint (edit->expr);
|
||||
}
|
||||
|
||||
void
|
||||
FcSubstPrint (const FcSubst *subst)
|
||||
{
|
||||
FcRule *r;
|
||||
FcRuleType last_type = FcRuleUnknown;
|
||||
|
||||
printf ("match\n");
|
||||
for (r = subst->rule; r; r = r->next)
|
||||
{
|
||||
if (last_type != r->type)
|
||||
{
|
||||
switch (r->type) {
|
||||
case FcRuleTest:
|
||||
printf ("[test]\n");
|
||||
break;
|
||||
case FcRuleEdit:
|
||||
printf ("[edit]\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
last_type = r->type;
|
||||
}
|
||||
printf ("\t");
|
||||
switch (r->type) {
|
||||
case FcRuleTest:
|
||||
FcTestPrint (r->u.test);
|
||||
break;
|
||||
case FcRuleEdit:
|
||||
FcEditPrint (r->u.edit);
|
||||
printf (";\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
void
|
||||
FcFontSetPrint (const FcFontSet *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf ("FontSet %d of %d\n", s->nfont, s->sfont);
|
||||
for (i = 0; i < s->nfont; i++)
|
||||
{
|
||||
printf ("Font %d ", i);
|
||||
FcPatternPrint (s->fonts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int FcDebugVal;
|
||||
|
||||
void
|
||||
FcInitDebug (void)
|
||||
{
|
||||
if (!FcDebugVal) {
|
||||
char *e;
|
||||
|
||||
e = getenv ("FC_DEBUG");
|
||||
if (e)
|
||||
{
|
||||
printf ("FC_DEBUG=%s\n", e);
|
||||
FcDebugVal = atoi (e);
|
||||
if (FcDebugVal < 0)
|
||||
FcDebugVal = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#define __fcdbg__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcdbg__
|
||||
316
project/jni/fontconfig/src/fcdefault.c
Normal file
316
project/jni/fontconfig/src/fcdefault.c
Normal file
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
* fontconfig/src/fcdefault.c
|
||||
*
|
||||
* Copyright © 2001 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
/* MT-safe */
|
||||
|
||||
static const struct {
|
||||
FcObject field;
|
||||
FcBool value;
|
||||
} FcBoolDefaults[] = {
|
||||
{ FC_HINTING_OBJECT, FcTrue }, /* !FT_LOAD_NO_HINTING */
|
||||
{ FC_VERTICAL_LAYOUT_OBJECT, FcFalse }, /* FC_LOAD_VERTICAL_LAYOUT */
|
||||
{ FC_AUTOHINT_OBJECT, FcFalse }, /* FC_LOAD_FORCE_AUTOHINT */
|
||||
{ FC_GLOBAL_ADVANCE_OBJECT, FcTrue }, /* !FC_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
|
||||
{ FC_EMBEDDED_BITMAP_OBJECT, FcTrue }, /* !FC_LOAD_NO_BITMAP */
|
||||
{ FC_DECORATIVE_OBJECT, FcFalse },
|
||||
};
|
||||
|
||||
#define NUM_FC_BOOL_DEFAULTS (int) (sizeof FcBoolDefaults / sizeof FcBoolDefaults[0])
|
||||
|
||||
FcStrSet *default_langs;
|
||||
|
||||
FcStrSet *
|
||||
FcGetDefaultLangs (void)
|
||||
{
|
||||
FcStrSet *result;
|
||||
retry:
|
||||
result = (FcStrSet *) fc_atomic_ptr_get (&default_langs);
|
||||
if (!result)
|
||||
{
|
||||
char *langs;
|
||||
|
||||
result = FcStrSetCreate ();
|
||||
|
||||
langs = getenv ("FC_LANG");
|
||||
if (!langs || !langs[0])
|
||||
langs = getenv ("LC_ALL");
|
||||
if (!langs || !langs[0])
|
||||
langs = getenv ("LC_CTYPE");
|
||||
if (!langs || !langs[0])
|
||||
langs = getenv ("LANG");
|
||||
if (langs && langs[0])
|
||||
{
|
||||
if (!FcStrSetAddLangs (result, langs))
|
||||
FcStrSetAdd (result, (const FcChar8 *) "en");
|
||||
}
|
||||
else
|
||||
FcStrSetAdd (result, (const FcChar8 *) "en");
|
||||
|
||||
FcRefSetConst (&result->ref);
|
||||
if (!fc_atomic_ptr_cmpexch (&default_langs, NULL, result)) {
|
||||
FcRefInit (&result->ref, 1);
|
||||
FcStrSetDestroy (result);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static FcChar8 *default_lang; /* MT-safe */
|
||||
|
||||
FcChar8 *
|
||||
FcGetDefaultLang (void)
|
||||
{
|
||||
FcChar8 *lang;
|
||||
retry:
|
||||
lang = fc_atomic_ptr_get (&default_lang);
|
||||
if (!lang)
|
||||
{
|
||||
FcStrSet *langs = FcGetDefaultLangs ();
|
||||
lang = FcStrdup (langs->strs[0]);
|
||||
FcStrSetDestroy (langs);
|
||||
|
||||
if (!fc_atomic_ptr_cmpexch (&default_lang, NULL, lang)) {
|
||||
free (lang);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
return lang;
|
||||
}
|
||||
|
||||
static FcChar8 *default_prgname;
|
||||
|
||||
FcChar8 *
|
||||
FcGetPrgname (void)
|
||||
{
|
||||
FcChar8 *prgname;
|
||||
retry:
|
||||
prgname = fc_atomic_ptr_get (&default_prgname);
|
||||
if (!prgname)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char buf[MAX_PATH+1];
|
||||
|
||||
/* TODO This is ASCII-only; fix it. */
|
||||
if (GetModuleFileNameA (GetModuleHandle (NULL), buf, sizeof (buf) / sizeof (buf[0])) > 0)
|
||||
{
|
||||
char *p;
|
||||
unsigned int len;
|
||||
|
||||
p = strrchr (buf, '\\');
|
||||
if (p)
|
||||
p++;
|
||||
else
|
||||
p = buf;
|
||||
|
||||
len = strlen (p);
|
||||
|
||||
if (len > 4 && 0 == strcmp (p + len - 4, ".exe"))
|
||||
{
|
||||
len -= 4;
|
||||
buf[len] = '\0';
|
||||
}
|
||||
|
||||
prgname = FcStrdup (p);
|
||||
}
|
||||
#elif defined (HAVE_GETPROGNAME)
|
||||
const char *q = getprogname ();
|
||||
if (q)
|
||||
prgname = FcStrdup (q);
|
||||
else
|
||||
prgname = FcStrdup ("");
|
||||
#else
|
||||
# if defined (HAVE_GETEXECNAME)
|
||||
const char *p = getexecname ();
|
||||
# elif defined (HAVE_READLINK)
|
||||
char buf[PATH_MAX + 1];
|
||||
int len;
|
||||
char *p = NULL;
|
||||
|
||||
len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
|
||||
if (len != -1)
|
||||
{
|
||||
buf[len] = '\0';
|
||||
p = buf;
|
||||
}
|
||||
# else
|
||||
char *p = NULL;
|
||||
# endif
|
||||
if (p)
|
||||
{
|
||||
char *r = strrchr (p, '/');
|
||||
if (r)
|
||||
r++;
|
||||
else
|
||||
r = p;
|
||||
|
||||
prgname = FcStrdup (r);
|
||||
}
|
||||
|
||||
if (!prgname)
|
||||
prgname = FcStrdup ("");
|
||||
#endif
|
||||
|
||||
if (!fc_atomic_ptr_cmpexch (&default_prgname, NULL, prgname)) {
|
||||
free (prgname);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
if (prgname && !prgname[0])
|
||||
return NULL;
|
||||
|
||||
return prgname;
|
||||
}
|
||||
|
||||
void
|
||||
FcDefaultFini (void)
|
||||
{
|
||||
FcChar8 *lang;
|
||||
FcStrSet *langs;
|
||||
FcChar8 *prgname;
|
||||
|
||||
lang = fc_atomic_ptr_get (&default_lang);
|
||||
if (lang && fc_atomic_ptr_cmpexch (&default_lang, lang, NULL)) {
|
||||
free (lang);
|
||||
}
|
||||
|
||||
langs = fc_atomic_ptr_get (&default_langs);
|
||||
if (langs && fc_atomic_ptr_cmpexch (&default_langs, langs, NULL)) {
|
||||
FcRefInit (&langs->ref, 1);
|
||||
FcStrSetDestroy (langs);
|
||||
}
|
||||
|
||||
prgname = fc_atomic_ptr_get (&default_prgname);
|
||||
if (prgname && fc_atomic_ptr_cmpexch (&default_prgname, prgname, NULL)) {
|
||||
free (prgname);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
FcDefaultSubstitute (FcPattern *pattern)
|
||||
{
|
||||
FcValue v, namelang, v2;
|
||||
int i;
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_WEIGHT_OBJECT, 0, &v) == FcResultNoMatch )
|
||||
FcPatternObjectAddInteger (pattern, FC_WEIGHT_OBJECT, FC_WEIGHT_NORMAL);
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_SLANT_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
FcPatternObjectAddInteger (pattern, FC_SLANT_OBJECT, FC_SLANT_ROMAN);
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_WIDTH_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
FcPatternObjectAddInteger (pattern, FC_WIDTH_OBJECT, FC_WIDTH_NORMAL);
|
||||
|
||||
for (i = 0; i < NUM_FC_BOOL_DEFAULTS; i++)
|
||||
if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch)
|
||||
FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value);
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
double dpi, size, scale;
|
||||
|
||||
if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
|
||||
{
|
||||
size = 12.0;
|
||||
(void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
|
||||
FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
|
||||
}
|
||||
if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
|
||||
{
|
||||
scale = 1.0;
|
||||
(void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
|
||||
FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
|
||||
}
|
||||
size *= scale;
|
||||
if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
|
||||
{
|
||||
dpi = 75.0;
|
||||
(void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
|
||||
FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
|
||||
}
|
||||
size *= dpi / 72.0;
|
||||
FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, size);
|
||||
}
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_FONTVERSION_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAddInteger (pattern, FC_FONTVERSION_OBJECT, 0x7fffffff);
|
||||
}
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_HINT_STYLE_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAddInteger (pattern, FC_HINT_STYLE_OBJECT, FC_HINT_FULL);
|
||||
}
|
||||
if (FcPatternObjectGet (pattern, FC_NAMELANG_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAddString (pattern, FC_NAMELANG_OBJECT, FcGetDefaultLang ());
|
||||
}
|
||||
/* shouldn't be failed. */
|
||||
FcPatternObjectGet (pattern, FC_NAMELANG_OBJECT, 0, &namelang);
|
||||
/* Add a fallback to ensure the english name when the requested language
|
||||
* isn't available. this would helps for the fonts that have non-English
|
||||
* name at the beginning.
|
||||
*/
|
||||
/* Set "en-us" instead of "en" to avoid giving higher score to "en".
|
||||
* This is a hack for the case that the orth is not like ll-cc, because,
|
||||
* if no namelang isn't explicitly set, it will has something like ll-cc
|
||||
* according to current locale. which may causes FcLangDifferentTerritory
|
||||
* at FcLangCompare(). thus, the English name is selected so that
|
||||
* exact matched "en" has higher score than ll-cc.
|
||||
*/
|
||||
v2.type = FcTypeString;
|
||||
v2.u.s = (FcChar8 *) "en-us";
|
||||
if (FcPatternObjectGet (pattern, FC_FAMILYLANG_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAdd (pattern, FC_FAMILYLANG_OBJECT, namelang, FcTrue);
|
||||
FcPatternObjectAddWithBinding (pattern, FC_FAMILYLANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
|
||||
}
|
||||
if (FcPatternObjectGet (pattern, FC_STYLELANG_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAdd (pattern, FC_STYLELANG_OBJECT, namelang, FcTrue);
|
||||
FcPatternObjectAddWithBinding (pattern, FC_STYLELANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
|
||||
}
|
||||
if (FcPatternObjectGet (pattern, FC_FULLNAMELANG_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcPatternObjectAdd (pattern, FC_FULLNAMELANG_OBJECT, namelang, FcTrue);
|
||||
FcPatternObjectAddWithBinding (pattern, FC_FULLNAMELANG_OBJECT, v2, FcValueBindingWeak, FcTrue);
|
||||
}
|
||||
|
||||
if (FcPatternObjectGet (pattern, FC_PRGNAME_OBJECT, 0, &v) == FcResultNoMatch)
|
||||
{
|
||||
FcChar8 *prgname = FcGetPrgname ();
|
||||
if (prgname)
|
||||
FcPatternObjectAddString (pattern, FC_PRGNAME_OBJECT, prgname);
|
||||
}
|
||||
}
|
||||
#define __fcdefault__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcdefault__
|
||||
36
project/jni/fontconfig/src/fcdeprecate.h
Normal file
36
project/jni/fontconfig/src/fcdeprecate.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright © 2007 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* These APIs are deprecated; still exported by the library, but not
|
||||
* declared in the public header file
|
||||
*/
|
||||
#ifndef _FCDEPRECATE_H_
|
||||
#define _FCDEPRECATE_H_
|
||||
|
||||
FcPublic int
|
||||
FcConfigGetRescanInverval (FcConfig *config);
|
||||
|
||||
FcPublic FcBool
|
||||
FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
|
||||
|
||||
#endif /* _FCDEPRECATE_H_ */
|
||||
379
project/jni/fontconfig/src/fcdir.c
Normal file
379
project/jni/fontconfig/src/fcdir.c
Normal file
@@ -0,0 +1,379 @@
|
||||
/*
|
||||
* fontconfig/src/fcdir.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <dirent.h>
|
||||
|
||||
FcBool
|
||||
FcFileIsDir (const FcChar8 *file)
|
||||
{
|
||||
struct stat statb;
|
||||
|
||||
if (FcStat (file, &statb) != 0)
|
||||
return FcFalse;
|
||||
return S_ISDIR(statb.st_mode);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFileIsLink (const FcChar8 *file)
|
||||
{
|
||||
#if HAVE_LSTAT
|
||||
struct stat statb;
|
||||
|
||||
if (lstat ((const char *)file, &statb) != 0)
|
||||
return FcFalse;
|
||||
return S_ISLNK (statb.st_mode);
|
||||
#else
|
||||
return FcFalse;
|
||||
#endif
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFileIsFile (const FcChar8 *file)
|
||||
{
|
||||
struct stat statb;
|
||||
|
||||
if (FcStat (file, &statb) != 0)
|
||||
return FcFalse;
|
||||
return S_ISREG (statb.st_mode);
|
||||
}
|
||||
|
||||
static FcBool
|
||||
FcFileScanFontConfig (FcFontSet *set,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcConfig *config)
|
||||
{
|
||||
FcPattern *font;
|
||||
FcBool ret = FcTrue;
|
||||
int id;
|
||||
int count = 0;
|
||||
|
||||
id = 0;
|
||||
do
|
||||
{
|
||||
font = 0;
|
||||
/*
|
||||
* Nothing in the cache, scan the file
|
||||
*/
|
||||
if (FcDebug () & FC_DBG_SCAN)
|
||||
{
|
||||
printf ("\tScanning file %s...", file);
|
||||
fflush (stdout);
|
||||
}
|
||||
font = FcFreeTypeQuery (file, id, blanks, &count);
|
||||
if (FcDebug () & FC_DBG_SCAN)
|
||||
printf ("done\n");
|
||||
|
||||
/*
|
||||
* Edit pattern with user-defined rules
|
||||
*/
|
||||
if (font && config && !FcConfigSubstitute (config, font, FcMatchScan))
|
||||
{
|
||||
FcPatternDestroy (font);
|
||||
font = NULL;
|
||||
ret = FcFalse;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the font
|
||||
*/
|
||||
if (font)
|
||||
{
|
||||
if (FcDebug() & FC_DBG_SCANV)
|
||||
{
|
||||
printf ("Final font pattern:\n");
|
||||
FcPatternPrint (font);
|
||||
}
|
||||
if (!FcFontSetAdd (set, font))
|
||||
{
|
||||
FcPatternDestroy (font);
|
||||
font = NULL;
|
||||
ret = FcFalse;
|
||||
}
|
||||
}
|
||||
else if (font)
|
||||
FcPatternDestroy (font);
|
||||
id++;
|
||||
} while (font && ret && id < count);
|
||||
return ret;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFileScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcConfig *config)
|
||||
{
|
||||
if (FcFileIsDir (file))
|
||||
return FcStrSetAdd (dirs, file);
|
||||
else
|
||||
{
|
||||
if (set)
|
||||
return FcFileScanFontConfig (set, blanks, file, config);
|
||||
else
|
||||
return FcTrue;
|
||||
}
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFileScan (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcFileCache *cache FC_UNUSED,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcBool force FC_UNUSED)
|
||||
{
|
||||
return FcFileScanConfig (set, dirs, blanks, file, FcConfigGetCurrent ());
|
||||
}
|
||||
|
||||
/*
|
||||
* Strcmp helper that takes pointers to pointers, copied from qsort(3) manpage
|
||||
*/
|
||||
static int
|
||||
cmpstringp(const void *p1, const void *p2)
|
||||
{
|
||||
return strcmp(* (char **) p1, * (char **) p2);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcDirScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *dir,
|
||||
FcBool force, /* XXX unused */
|
||||
FcConfig *config)
|
||||
{
|
||||
DIR *d;
|
||||
struct dirent *e;
|
||||
FcStrSet *files;
|
||||
FcChar8 *file;
|
||||
FcChar8 *base;
|
||||
FcBool ret = FcTrue;
|
||||
int i;
|
||||
|
||||
if (!force)
|
||||
return FcFalse;
|
||||
|
||||
if (!set && !dirs)
|
||||
return FcTrue;
|
||||
|
||||
if (!blanks)
|
||||
blanks = FcConfigGetBlanks (config);
|
||||
|
||||
/* freed below */
|
||||
file = (FcChar8 *) malloc (strlen ((char *) dir) + 1 + FC_MAX_FILE_LEN + 1);
|
||||
if (!file) {
|
||||
ret = FcFalse;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
strcpy ((char *) file, (char *) dir);
|
||||
strcat ((char *) file, "/");
|
||||
base = file + strlen ((char *) file);
|
||||
|
||||
if (FcDebug () & FC_DBG_SCAN)
|
||||
printf ("\tScanning dir %s\n", dir);
|
||||
|
||||
d = opendir ((char *) dir);
|
||||
if (!d)
|
||||
{
|
||||
/* Don't complain about missing directories */
|
||||
if (errno != ENOENT)
|
||||
ret = FcFalse;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
files = FcStrSetCreate ();
|
||||
if (!files)
|
||||
{
|
||||
ret = FcFalse;
|
||||
goto bail1;
|
||||
}
|
||||
while ((e = readdir (d)))
|
||||
{
|
||||
if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN)
|
||||
{
|
||||
strcpy ((char *) base, (char *) e->d_name);
|
||||
if (!FcStrSetAdd (files, file)) {
|
||||
ret = FcFalse;
|
||||
goto bail2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort files to make things prettier
|
||||
*/
|
||||
qsort(files->strs, files->num, sizeof(FcChar8 *), cmpstringp);
|
||||
|
||||
/*
|
||||
* Scan file files to build font patterns
|
||||
*/
|
||||
for (i = 0; i < files->num; i++)
|
||||
FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
|
||||
|
||||
bail2:
|
||||
FcStrSetDestroy (files);
|
||||
bail1:
|
||||
closedir (d);
|
||||
bail:
|
||||
if (file)
|
||||
free (file);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcDirScan (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcFileCache *cache, /* XXX unused */
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *dir,
|
||||
FcBool force /* XXX unused */)
|
||||
{
|
||||
if (cache || !force)
|
||||
return FcFalse;
|
||||
|
||||
return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent ());
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan the specified directory and construct a cache of its contents
|
||||
*/
|
||||
FcCache *
|
||||
FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
|
||||
{
|
||||
FcStrSet *dirs;
|
||||
FcFontSet *set;
|
||||
FcCache *cache = NULL;
|
||||
struct stat dir_stat;
|
||||
|
||||
if (FcDebug () & FC_DBG_FONTSET)
|
||||
printf ("cache scan dir %s\n", dir);
|
||||
|
||||
if (FcStatChecksum (dir, &dir_stat) < 0)
|
||||
goto bail;
|
||||
|
||||
set = FcFontSetCreate();
|
||||
if (!set)
|
||||
goto bail;
|
||||
|
||||
dirs = FcStrSetCreate ();
|
||||
if (!dirs)
|
||||
goto bail1;
|
||||
|
||||
/*
|
||||
* Scan the dir
|
||||
*/
|
||||
if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config))
|
||||
goto bail2;
|
||||
|
||||
/*
|
||||
* Build the cache object
|
||||
*/
|
||||
cache = FcDirCacheBuild (set, dir, &dir_stat, dirs);
|
||||
if (!cache)
|
||||
goto bail2;
|
||||
|
||||
/*
|
||||
* Write out the cache file, ignoring any troubles
|
||||
*/
|
||||
FcDirCacheWrite (cache, config);
|
||||
|
||||
bail2:
|
||||
FcStrSetDestroy (dirs);
|
||||
bail1:
|
||||
FcFontSetDestroy (set);
|
||||
bail:
|
||||
return cache;
|
||||
}
|
||||
|
||||
FcCache *
|
||||
FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
|
||||
{
|
||||
FcCache *cache = FcDirCacheLoad (dir, config, NULL);
|
||||
FcCache *new = NULL;
|
||||
struct stat dir_stat;
|
||||
FcStrSet *dirs;
|
||||
|
||||
if (!cache)
|
||||
return NULL;
|
||||
if (FcStatChecksum (dir, &dir_stat) < 0)
|
||||
goto bail;
|
||||
dirs = FcStrSetCreate ();
|
||||
if (!dirs)
|
||||
goto bail;
|
||||
|
||||
/*
|
||||
* Scan the dir
|
||||
*/
|
||||
if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config))
|
||||
goto bail1;
|
||||
/*
|
||||
* Rebuild the cache object
|
||||
*/
|
||||
new = FcDirCacheRebuild (cache, &dir_stat, dirs);
|
||||
if (!new)
|
||||
goto bail1;
|
||||
FcDirCacheUnload (cache);
|
||||
/*
|
||||
* Write out the cache file, ignoring any troubles
|
||||
*/
|
||||
FcDirCacheWrite (new, config);
|
||||
|
||||
bail1:
|
||||
FcStrSetDestroy (dirs);
|
||||
bail:
|
||||
return new;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read (or construct) the cache for a directory
|
||||
*/
|
||||
FcCache *
|
||||
FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
|
||||
{
|
||||
FcCache *cache = NULL;
|
||||
|
||||
/* Try to use existing cache file */
|
||||
if (!force)
|
||||
cache = FcDirCacheLoad (dir, config, NULL);
|
||||
|
||||
/* Not using existing cache file, construct new cache */
|
||||
if (!cache)
|
||||
cache = FcDirCacheScan (dir, config);
|
||||
|
||||
return cache;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcDirSave (FcFontSet *set FC_UNUSED, FcStrSet * dirs FC_UNUSED, const FcChar8 *dir FC_UNUSED)
|
||||
{
|
||||
return FcFalse; /* XXX deprecated */
|
||||
}
|
||||
#define __fcdir__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcdir__
|
||||
1220
project/jni/fontconfig/src/fcformat.c
Normal file
1220
project/jni/fontconfig/src/fcformat.c
Normal file
File diff suppressed because it is too large
Load Diff
2822
project/jni/fontconfig/src/fcfreetype.c
Normal file
2822
project/jni/fontconfig/src/fcfreetype.c
Normal file
File diff suppressed because it is too large
Load Diff
149
project/jni/fontconfig/src/fcfs.c
Normal file
149
project/jni/fontconfig/src/fcfs.c
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* fontconfig/src/fcfs.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
FcFontSet *
|
||||
FcFontSetCreate (void)
|
||||
{
|
||||
FcFontSet *s;
|
||||
|
||||
s = (FcFontSet *) malloc (sizeof (FcFontSet));
|
||||
if (!s)
|
||||
return 0;
|
||||
s->nfont = 0;
|
||||
s->sfont = 0;
|
||||
s->fonts = 0;
|
||||
return s;
|
||||
}
|
||||
|
||||
void
|
||||
FcFontSetDestroy (FcFontSet *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < s->nfont; i++)
|
||||
FcPatternDestroy (s->fonts[i]);
|
||||
if (s->fonts)
|
||||
free (s->fonts);
|
||||
free (s);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFontSetAdd (FcFontSet *s, FcPattern *font)
|
||||
{
|
||||
FcPattern **f;
|
||||
int sfont;
|
||||
|
||||
if (s->nfont == s->sfont)
|
||||
{
|
||||
sfont = s->sfont + 32;
|
||||
if (s->fonts)
|
||||
f = (FcPattern **) realloc (s->fonts, sfont * sizeof (FcPattern *));
|
||||
else
|
||||
f = (FcPattern **) malloc (sfont * sizeof (FcPattern *));
|
||||
if (!f)
|
||||
return FcFalse;
|
||||
s->sfont = sfont;
|
||||
s->fonts = f;
|
||||
}
|
||||
s->fonts[s->nfont++] = font;
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!FcSerializeAlloc (serialize, s, sizeof (FcFontSet)))
|
||||
return FcFalse;
|
||||
if (!FcSerializeAlloc (serialize, s->fonts, s->nfont * sizeof (FcPattern *)))
|
||||
return FcFalse;
|
||||
for (i = 0; i < s->nfont; i++)
|
||||
{
|
||||
if (!FcPatternSerializeAlloc (serialize, s->fonts[i]))
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcFontSet *
|
||||
FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s)
|
||||
{
|
||||
int i;
|
||||
FcFontSet *s_serialize;
|
||||
FcPattern **fonts_serialize;
|
||||
FcPattern *p_serialize;
|
||||
|
||||
s_serialize = FcSerializePtr (serialize, s);
|
||||
if (!s_serialize)
|
||||
return NULL;
|
||||
*s_serialize = *s;
|
||||
s_serialize->sfont = s_serialize->nfont;
|
||||
|
||||
fonts_serialize = FcSerializePtr (serialize, s->fonts);
|
||||
if (!fonts_serialize)
|
||||
return NULL;
|
||||
s_serialize->fonts = FcPtrToEncodedOffset (s_serialize,
|
||||
fonts_serialize, FcPattern *);
|
||||
|
||||
for (i = 0; i < s->nfont; i++)
|
||||
{
|
||||
p_serialize = FcPatternSerialize (serialize, s->fonts[i]);
|
||||
if (!p_serialize)
|
||||
return NULL;
|
||||
fonts_serialize[i] = FcPtrToEncodedOffset (s_serialize,
|
||||
p_serialize,
|
||||
FcPattern);
|
||||
}
|
||||
|
||||
return s_serialize;
|
||||
}
|
||||
|
||||
FcFontSet *
|
||||
FcFontSetDeserialize (const FcFontSet *set)
|
||||
{
|
||||
int i;
|
||||
FcFontSet *new = FcFontSetCreate ();
|
||||
|
||||
if (!new)
|
||||
return NULL;
|
||||
for (i = 0; i < set->nfont; i++)
|
||||
{
|
||||
if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i))))
|
||||
goto bail;
|
||||
}
|
||||
|
||||
return new;
|
||||
bail:
|
||||
FcFontSetDestroy (new);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define __fcfs__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcfs__
|
||||
12
project/jni/fontconfig/src/fcftalias.h
Normal file
12
project/jni/fontconfig/src/fcftalias.h
Normal file
@@ -0,0 +1,12 @@
|
||||
extern __typeof (FcFreeTypeCharIndex) IA__FcFreeTypeCharIndex __attribute((visibility("hidden")));
|
||||
#define FcFreeTypeCharIndex IA__FcFreeTypeCharIndex
|
||||
extern __typeof (FcFreeTypeCharSetAndSpacing) IA__FcFreeTypeCharSetAndSpacing __attribute((visibility("hidden")));
|
||||
#define FcFreeTypeCharSetAndSpacing IA__FcFreeTypeCharSetAndSpacing
|
||||
extern __typeof (FcFreeTypeCharSet) IA__FcFreeTypeCharSet __attribute((visibility("hidden")));
|
||||
#define FcFreeTypeCharSet IA__FcFreeTypeCharSet
|
||||
extern __typeof (FcPatternGetFTFace) IA__FcPatternGetFTFace __attribute((visibility("hidden")));
|
||||
#define FcPatternGetFTFace IA__FcPatternGetFTFace
|
||||
extern __typeof (FcPatternAddFTFace) IA__FcPatternAddFTFace __attribute((visibility("hidden")));
|
||||
#define FcPatternAddFTFace IA__FcPatternAddFTFace
|
||||
extern __typeof (FcFreeTypeQueryFace) IA__FcFreeTypeQueryFace __attribute((visibility("hidden")));
|
||||
#define FcFreeTypeQueryFace IA__FcFreeTypeQueryFace
|
||||
20
project/jni/fontconfig/src/fcftaliastail.h
Normal file
20
project/jni/fontconfig/src/fcftaliastail.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#if HAVE_GNUC_ATTRIBUTE
|
||||
#ifdef __fcfreetype__
|
||||
# undef FcFreeTypeCharIndex
|
||||
extern __typeof (FcFreeTypeCharIndex) FcFreeTypeCharIndex __attribute((alias("IA__FcFreeTypeCharIndex"), visibility("default")));
|
||||
# undef FcFreeTypeCharSetAndSpacing
|
||||
extern __typeof (FcFreeTypeCharSetAndSpacing) FcFreeTypeCharSetAndSpacing __attribute((alias("IA__FcFreeTypeCharSetAndSpacing"), visibility("default")));
|
||||
# undef FcFreeTypeCharSet
|
||||
extern __typeof (FcFreeTypeCharSet) FcFreeTypeCharSet __attribute((alias("IA__FcFreeTypeCharSet"), visibility("default")));
|
||||
#endif /* __fcfreetype__ */
|
||||
#ifdef __fcpat__
|
||||
# undef FcPatternGetFTFace
|
||||
extern __typeof (FcPatternGetFTFace) FcPatternGetFTFace __attribute((alias("IA__FcPatternGetFTFace"), visibility("default")));
|
||||
# undef FcPatternAddFTFace
|
||||
extern __typeof (FcPatternAddFTFace) FcPatternAddFTFace __attribute((alias("IA__FcPatternAddFTFace"), visibility("default")));
|
||||
#endif /* __fcpat__ */
|
||||
#ifdef __fcfreetype__
|
||||
# undef FcFreeTypeQueryFace
|
||||
extern __typeof (FcFreeTypeQueryFace) FcFreeTypeQueryFace __attribute((alias("IA__FcFreeTypeQueryFace"), visibility("default")));
|
||||
#endif /* */
|
||||
#endif /* HAVE_GNUC_ATTRIBUTE */
|
||||
54
project/jni/fontconfig/src/fcftint.h
Normal file
54
project/jni/fontconfig/src/fcftint.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright © 2007 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _FCFTINT_H_
|
||||
#define _FCFTINT_H_
|
||||
|
||||
#include <fontconfig/fcfreetype.h>
|
||||
|
||||
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
|
||||
#define FcPrivate __attribute__((__visibility__("hidden")))
|
||||
#define HAVE_GNUC_ATTRIBUTE 1
|
||||
#include "fcftalias.h"
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
#define FcPrivate __hidden
|
||||
#else /* not gcc >= 3.3 and not Sun Studio >= 8 */
|
||||
#define FcPrivate
|
||||
#endif
|
||||
|
||||
/* fcfreetype.c */
|
||||
FcPrivate FcBool
|
||||
FcFreeTypeIsExclusiveLang (const FcChar8 *lang);
|
||||
|
||||
FcPrivate FcBool
|
||||
FcFreeTypeHasLang (FcPattern *pattern, const FcChar8 *lang);
|
||||
|
||||
FcPrivate FcChar32
|
||||
FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map);
|
||||
|
||||
FcPrivate FcChar32
|
||||
FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map);
|
||||
|
||||
FcPrivate const FcCharMap *
|
||||
FcFreeTypeGetPrivateMap (FT_Encoding encoding);
|
||||
|
||||
#endif /* _FCFTINT_H_ */
|
||||
317
project/jni/fontconfig/src/fchash.c
Normal file
317
project/jni/fontconfig/src/fchash.c
Normal file
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* fontconfig/src/fchash.c
|
||||
*
|
||||
* Copyright © 2003 Keith Packard
|
||||
* Copyright © 2013 Red Hat, Inc.
|
||||
* Red Hat Author(s): Akira TAGOH
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "fcint.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ROTRN(w, v, n) ((((FcChar32)v) >> n) | (((FcChar32)v) << (w - n)))
|
||||
#define ROTR32(v, n) ROTRN(32, v, n)
|
||||
#define SHR(v, n) (v >> n)
|
||||
#define Ch(x, y, z) ((x & y) ^ (~x & z))
|
||||
#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
|
||||
#define SS0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22))
|
||||
#define SS1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25))
|
||||
#define ss0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ SHR(x, 3))
|
||||
#define ss1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ SHR(x, 10))
|
||||
|
||||
|
||||
static FcChar32 *
|
||||
FcHashInitSHA256Digest (void)
|
||||
{
|
||||
int i;
|
||||
static const FcChar32 h[] = {
|
||||
0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL,
|
||||
0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL
|
||||
};
|
||||
FcChar32 *ret = malloc (sizeof (FcChar32) * 8);
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
ret[i] = h[i];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
FcHashComputeSHA256Digest (FcChar32 *hash,
|
||||
const char *block)
|
||||
{
|
||||
static const FcChar32 k[] = {
|
||||
0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
|
||||
0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
|
||||
0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
|
||||
0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
|
||||
0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
|
||||
0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
|
||||
0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
|
||||
0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
|
||||
0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
|
||||
0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
|
||||
0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
|
||||
0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
|
||||
0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
|
||||
0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
|
||||
0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
|
||||
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
|
||||
};
|
||||
FcChar32 w[64], i, j, t1, t2;
|
||||
FcChar32 a, b, c, d, e, f, g, h;
|
||||
|
||||
#define H(n) (hash[n])
|
||||
|
||||
a = H(0);
|
||||
b = H(1);
|
||||
c = H(2);
|
||||
d = H(3);
|
||||
e = H(4);
|
||||
f = H(5);
|
||||
g = H(6);
|
||||
h = H(7);
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
j = (block[(i * 4) + 0] & 0xff) << (8 * 3);
|
||||
j |= (block[(i * 4) + 1] & 0xff) << (8 * 2);
|
||||
j |= (block[(i * 4) + 2] & 0xff) << (8 * 1);
|
||||
j |= (block[(i * 4) + 3] & 0xff);
|
||||
w[i] = j;
|
||||
}
|
||||
for (i = 16; i < 64; i++)
|
||||
w[i] = ss1(w[i - 2]) + w[i - 7] + ss0(w[i - 15]) + w[i - 16];
|
||||
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
t1 = h + SS1(e) + Ch(e, f, g) + k[i] + w[i];
|
||||
t2 = SS0(a) + Maj(a, b, c);
|
||||
h = g;
|
||||
g = f;
|
||||
f = e;
|
||||
e = d + t1;
|
||||
d = c;
|
||||
c = b;
|
||||
b = a;
|
||||
a = t1 + t2;
|
||||
}
|
||||
|
||||
H(0) += a;
|
||||
H(1) += b;
|
||||
H(2) += c;
|
||||
H(3) += d;
|
||||
H(4) += e;
|
||||
H(5) += f;
|
||||
H(6) += g;
|
||||
H(7) += h;
|
||||
|
||||
#undef H
|
||||
}
|
||||
|
||||
static FcChar8 *
|
||||
FcHashSHA256ToString (FcChar32 *hash)
|
||||
{
|
||||
FcChar8 *ret = NULL;
|
||||
static const char hex[] = "0123456789abcdef";
|
||||
int i, j;
|
||||
|
||||
if (hash)
|
||||
{
|
||||
ret = malloc (sizeof (FcChar8) * (8 * 8 + 7 + 1));
|
||||
if (!ret)
|
||||
return NULL;
|
||||
memcpy (ret, "sha256:", 7);
|
||||
#define H(n) hash[n]
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
FcChar32 v = H(i);
|
||||
|
||||
for (j = 0; j < 8; j++)
|
||||
ret[7 + (i * 8) + j] = hex[(v >> (28 - j * 4)) & 0xf];
|
||||
}
|
||||
ret[7 + i * 8] = 0;
|
||||
#undef H
|
||||
free (hash);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcHashGetSHA256Digest (const FcChar8 *input_strings,
|
||||
size_t len)
|
||||
{
|
||||
size_t i, round_len = len / 64;
|
||||
char block[64];
|
||||
FcChar32 *ret = FcHashInitSHA256Digest ();
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < round_len; i++)
|
||||
{
|
||||
FcHashComputeSHA256Digest (ret, (const char *)&input_strings[i * 64]);
|
||||
}
|
||||
/* padding */
|
||||
if ((len % 64) != 0)
|
||||
memcpy (block, &input_strings[len / 64], len % 64);
|
||||
memset (&block[len % 64], 0, 64 - (len % 64));
|
||||
block[len % 64] = 0x80;
|
||||
if ((64 - (len % 64)) < 9)
|
||||
{
|
||||
/* process a block once */
|
||||
FcHashComputeSHA256Digest (ret, block);
|
||||
memset (block, 0, 64);
|
||||
}
|
||||
/* set input size at the end */
|
||||
len *= 8;
|
||||
block[63 - 0] = (uint64_t)len & 0xff;
|
||||
block[63 - 1] = ((uint64_t)len >> 8) & 0xff;
|
||||
block[63 - 2] = ((uint64_t)len >> 16) & 0xff;
|
||||
block[63 - 3] = ((uint64_t)len >> 24) & 0xff;
|
||||
block[63 - 4] = ((uint64_t)len >> 32) & 0xff;
|
||||
block[63 - 5] = ((uint64_t)len >> 40) & 0xff;
|
||||
block[63 - 6] = ((uint64_t)len >> 48) & 0xff;
|
||||
block[63 - 7] = ((uint64_t)len >> 56) & 0xff;
|
||||
FcHashComputeSHA256Digest (ret, block);
|
||||
|
||||
return FcHashSHA256ToString (ret);
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcHashGetSHA256DigestFromFile (const FcChar8 *filename)
|
||||
{
|
||||
FILE *fp = fopen ((const char *)filename, "rb");
|
||||
char ibuf[64];
|
||||
FcChar32 *ret;
|
||||
size_t len;
|
||||
struct stat st;
|
||||
|
||||
if (!fp)
|
||||
return NULL;
|
||||
|
||||
if (FcStat (filename, &st))
|
||||
goto bail0;
|
||||
|
||||
ret = FcHashInitSHA256Digest ();
|
||||
if (!ret)
|
||||
goto bail0;
|
||||
|
||||
while (!feof (fp))
|
||||
{
|
||||
if ((len = fread (ibuf, sizeof (char), 64, fp)) < 64)
|
||||
{
|
||||
uint64_t v;
|
||||
|
||||
/* add a padding */
|
||||
memset (&ibuf[len], 0, 64 - len);
|
||||
ibuf[len] = 0x80;
|
||||
if ((64 - len) < 9)
|
||||
{
|
||||
/* process a block once */
|
||||
FcHashComputeSHA256Digest (ret, ibuf);
|
||||
memset (ibuf, 0, 64);
|
||||
}
|
||||
/* set input size at the end */
|
||||
v = (long)st.st_size * 8;
|
||||
ibuf[63 - 0] = v & 0xff;
|
||||
ibuf[63 - 1] = (v >> 8) & 0xff;
|
||||
ibuf[63 - 2] = (v >> 16) & 0xff;
|
||||
ibuf[63 - 3] = (v >> 24) & 0xff;
|
||||
ibuf[63 - 4] = (v >> 32) & 0xff;
|
||||
ibuf[63 - 5] = (v >> 40) & 0xff;
|
||||
ibuf[63 - 6] = (v >> 48) & 0xff;
|
||||
ibuf[63 - 7] = (v >> 56) & 0xff;
|
||||
FcHashComputeSHA256Digest (ret, ibuf);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
FcHashComputeSHA256Digest (ret, ibuf);
|
||||
}
|
||||
}
|
||||
fclose (fp);
|
||||
|
||||
return FcHashSHA256ToString (ret);
|
||||
|
||||
bail0:
|
||||
fclose (fp);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcHashGetSHA256DigestFromMemory (const char *fontdata,
|
||||
size_t length)
|
||||
{
|
||||
char ibuf[64];
|
||||
FcChar32 *ret;
|
||||
size_t i = 0;
|
||||
|
||||
ret = FcHashInitSHA256Digest ();
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
while (i <= length)
|
||||
{
|
||||
if ((length - i) < 64)
|
||||
{
|
||||
uint64_t v;
|
||||
size_t n;
|
||||
|
||||
/* add a padding */
|
||||
n = length - i;
|
||||
if (n > 0)
|
||||
memcpy (ibuf, &fontdata[i], n);
|
||||
memset (&ibuf[n], 0, 64 - n);
|
||||
ibuf[n] = 0x80;
|
||||
if ((64 - n) < 9)
|
||||
{
|
||||
/* process a block once */
|
||||
FcHashComputeSHA256Digest (ret, ibuf);
|
||||
memset (ibuf, 0, 64);
|
||||
}
|
||||
/* set input size at the end */
|
||||
v = length * 8;
|
||||
ibuf[63 - 0] = v & 0xff;
|
||||
ibuf[63 - 1] = (v >> 8) & 0xff;
|
||||
ibuf[63 - 2] = (v >> 16) & 0xff;
|
||||
ibuf[63 - 3] = (v >> 24) & 0xff;
|
||||
ibuf[63 - 4] = (v >> 32) & 0xff;
|
||||
ibuf[63 - 5] = (v >> 40) & 0xff;
|
||||
ibuf[63 - 6] = (v >> 48) & 0xff;
|
||||
ibuf[63 - 7] = (v >> 56) & 0xff;
|
||||
FcHashComputeSHA256Digest (ret, ibuf);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
FcHashComputeSHA256Digest (ret, &fontdata[i]);
|
||||
}
|
||||
i += 64;
|
||||
}
|
||||
|
||||
return FcHashSHA256ToString (ret);
|
||||
}
|
||||
215
project/jni/fontconfig/src/fcinit.c
Normal file
215
project/jni/fontconfig/src/fcinit.c
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* fontconfig/src/fcinit.c
|
||||
*
|
||||
* Copyright © 2001 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(FC_ATOMIC_INT_NIL)
|
||||
#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe.")
|
||||
#endif
|
||||
#if defined(FC_MUTEX_IMPL_NIL)
|
||||
#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe.")
|
||||
#endif
|
||||
#if defined(FC_ATOMIC_INT_NIL) || defined(FC_MUTEX_IMPL_NIL)
|
||||
#pragma message("To suppress these warnings, define FC_NO_MT.")
|
||||
#endif
|
||||
|
||||
static FcConfig *
|
||||
FcInitFallbackConfig (void)
|
||||
{
|
||||
FcConfig *config;
|
||||
|
||||
config = FcConfigCreate ();
|
||||
if (!config)
|
||||
goto bail0;
|
||||
if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
|
||||
goto bail1;
|
||||
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
|
||||
goto bail1;
|
||||
return config;
|
||||
|
||||
bail1:
|
||||
FcConfigDestroy (config);
|
||||
bail0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
FcGetVersion (void)
|
||||
{
|
||||
return FC_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the configuration files
|
||||
*/
|
||||
FcConfig *
|
||||
FcInitLoadOwnConfig (FcConfig *config)
|
||||
{
|
||||
if (!config)
|
||||
{
|
||||
config = FcConfigCreate ();
|
||||
if (!config)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FcInitDebug ();
|
||||
|
||||
if (!FcConfigParseAndLoad (config, 0, FcTrue))
|
||||
{
|
||||
FcConfigDestroy (config);
|
||||
return FcInitFallbackConfig ();
|
||||
}
|
||||
|
||||
if (config->cacheDirs && config->cacheDirs->num == 0)
|
||||
{
|
||||
FcChar8 *prefix, *p;
|
||||
size_t plen;
|
||||
|
||||
fprintf (stderr,
|
||||
"Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
|
||||
fprintf (stderr,
|
||||
"Fontconfig warning: adding <cachedir>%s</cachedir>\n",
|
||||
FC_CACHEDIR);
|
||||
prefix = FcConfigXdgCacheHome ();
|
||||
if (!prefix)
|
||||
goto bail;
|
||||
plen = strlen ((const char *)prefix);
|
||||
p = realloc (prefix, plen + 12);
|
||||
if (!p)
|
||||
goto bail;
|
||||
prefix = p;
|
||||
memcpy (&prefix[plen], FC_DIR_SEPARATOR_S "fontconfig", 11);
|
||||
prefix[plen + 11] = 0;
|
||||
fprintf (stderr,
|
||||
"Fontconfig warning: adding <cachedir prefix=\"xdg\">fontconfig</cachedir>\n");
|
||||
|
||||
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) ||
|
||||
!FcConfigAddCacheDir (config, (FcChar8 *) prefix))
|
||||
{
|
||||
bail:
|
||||
fprintf (stderr,
|
||||
"Fontconfig error: out of memory");
|
||||
if (prefix)
|
||||
FcStrFree (prefix);
|
||||
FcConfigDestroy (config);
|
||||
return FcInitFallbackConfig ();
|
||||
}
|
||||
FcStrFree (prefix);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
FcConfig *
|
||||
FcInitLoadConfig (void)
|
||||
{
|
||||
return FcInitLoadOwnConfig (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load the configuration files and scan for available fonts
|
||||
*/
|
||||
FcConfig *
|
||||
FcInitLoadOwnConfigAndFonts (FcConfig *config)
|
||||
{
|
||||
config = FcInitLoadOwnConfig (config);
|
||||
if (!config)
|
||||
return 0;
|
||||
if (!FcConfigBuildFonts (config))
|
||||
{
|
||||
FcConfigDestroy (config);
|
||||
return 0;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
FcConfig *
|
||||
FcInitLoadConfigAndFonts (void)
|
||||
{
|
||||
return FcInitLoadOwnConfigAndFonts (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the default library configuration
|
||||
*/
|
||||
FcBool
|
||||
FcInit (void)
|
||||
{
|
||||
return FcConfigInit ();
|
||||
}
|
||||
|
||||
/*
|
||||
* Free all library-allocated data structures.
|
||||
*/
|
||||
void
|
||||
FcFini (void)
|
||||
{
|
||||
FcConfigFini ();
|
||||
FcCacheFini ();
|
||||
FcDefaultFini ();
|
||||
}
|
||||
|
||||
/*
|
||||
* Reread the configuration and available font lists
|
||||
*/
|
||||
FcBool
|
||||
FcInitReinitialize (void)
|
||||
{
|
||||
FcConfig *config;
|
||||
|
||||
config = FcInitLoadConfigAndFonts ();
|
||||
if (!config)
|
||||
return FcFalse;
|
||||
return FcConfigSetCurrent (config);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcInitBringUptoDate (void)
|
||||
{
|
||||
FcConfig *config = FcConfigGetCurrent ();
|
||||
time_t now;
|
||||
|
||||
/*
|
||||
* rescanInterval == 0 disables automatic up to date
|
||||
*/
|
||||
if (config->rescanInterval == 0)
|
||||
return FcTrue;
|
||||
/*
|
||||
* Check no more often than rescanInterval seconds
|
||||
*/
|
||||
now = time (0);
|
||||
if (config->rescanTime + config->rescanInterval - now > 0)
|
||||
return FcTrue;
|
||||
/*
|
||||
* If up to date, don't reload configuration
|
||||
*/
|
||||
if (FcConfigUptoDate (0))
|
||||
return FcTrue;
|
||||
return FcInitReinitialize ();
|
||||
}
|
||||
|
||||
#define __fcinit__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcinit__
|
||||
1168
project/jni/fontconfig/src/fcint.h
Normal file
1168
project/jni/fontconfig/src/fcint.h
Normal file
File diff suppressed because it is too large
Load Diff
1059
project/jni/fontconfig/src/fclang.c
Normal file
1059
project/jni/fontconfig/src/fclang.c
Normal file
File diff suppressed because it is too large
Load Diff
607
project/jni/fontconfig/src/fclist.c
Normal file
607
project/jni/fontconfig/src/fclist.c
Normal file
@@ -0,0 +1,607 @@
|
||||
/*
|
||||
* fontconfig/src/fclist.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
FcObjectSet *
|
||||
FcObjectSetCreate (void)
|
||||
{
|
||||
FcObjectSet *os;
|
||||
|
||||
os = (FcObjectSet *) malloc (sizeof (FcObjectSet));
|
||||
if (!os)
|
||||
return 0;
|
||||
os->nobject = 0;
|
||||
os->sobject = 0;
|
||||
os->objects = 0;
|
||||
return os;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcObjectSetAdd (FcObjectSet *os, const char *object)
|
||||
{
|
||||
int s;
|
||||
const char **objects;
|
||||
int high, low, mid, c;
|
||||
|
||||
if (os->nobject == os->sobject)
|
||||
{
|
||||
s = os->sobject + 4;
|
||||
if (os->objects)
|
||||
objects = (const char **) realloc ((void *) os->objects,
|
||||
s * sizeof (const char *));
|
||||
else
|
||||
objects = (const char **) malloc (s * sizeof (const char *));
|
||||
if (!objects)
|
||||
return FcFalse;
|
||||
os->objects = objects;
|
||||
os->sobject = s;
|
||||
}
|
||||
high = os->nobject - 1;
|
||||
low = 0;
|
||||
mid = 0;
|
||||
c = 1;
|
||||
object = strdup (object);
|
||||
while (low <= high)
|
||||
{
|
||||
mid = (low + high) >> 1;
|
||||
c = os->objects[mid] - object;
|
||||
if (c == 0)
|
||||
{
|
||||
FcFree (object);
|
||||
return FcTrue;
|
||||
}
|
||||
if (c < 0)
|
||||
low = mid + 1;
|
||||
else
|
||||
high = mid - 1;
|
||||
}
|
||||
if (c < 0)
|
||||
mid++;
|
||||
memmove (os->objects + mid + 1, os->objects + mid,
|
||||
(os->nobject - mid) * sizeof (const char *));
|
||||
os->objects[mid] = object;
|
||||
os->nobject++;
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
void
|
||||
FcObjectSetDestroy (FcObjectSet *os)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (os->objects)
|
||||
{
|
||||
for (i = 0; i < os->nobject; i++)
|
||||
FcFree (os->objects[i]);
|
||||
|
||||
free ((void *) os->objects);
|
||||
}
|
||||
free (os);
|
||||
}
|
||||
|
||||
FcObjectSet *
|
||||
FcObjectSetVaBuild (const char *first, va_list va)
|
||||
{
|
||||
FcObjectSet *ret;
|
||||
|
||||
FcObjectSetVapBuild (ret, first, va);
|
||||
return ret;
|
||||
}
|
||||
|
||||
FcObjectSet *
|
||||
FcObjectSetBuild (const char *first, ...)
|
||||
{
|
||||
va_list va;
|
||||
FcObjectSet *os;
|
||||
|
||||
va_start (va, first);
|
||||
FcObjectSetVapBuild (os, first, va);
|
||||
va_end (va);
|
||||
return os;
|
||||
}
|
||||
|
||||
/*
|
||||
* Font must have a containing value for every value in the pattern
|
||||
*/
|
||||
static FcBool
|
||||
FcListValueListMatchAny (FcValueListPtr patOrig, /* pattern */
|
||||
FcValueListPtr fntOrig) /* font */
|
||||
{
|
||||
FcValueListPtr pat, fnt;
|
||||
|
||||
for (pat = patOrig; pat != NULL; pat = FcValueListNext(pat))
|
||||
{
|
||||
for (fnt = fntOrig; fnt != NULL; fnt = FcValueListNext(fnt))
|
||||
{
|
||||
/*
|
||||
* make sure the font 'contains' the pattern.
|
||||
* (OpListing is OpContains except for strings
|
||||
* where it requires an exact match)
|
||||
*/
|
||||
if (FcConfigCompareValue (&fnt->value,
|
||||
FC_OP (FcOpListing, FcOpFlagIgnoreBlanks),
|
||||
&pat->value))
|
||||
break;
|
||||
}
|
||||
if (fnt == NULL)
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
static FcBool
|
||||
FcListValueListEqual (FcValueListPtr v1orig,
|
||||
FcValueListPtr v2orig)
|
||||
{
|
||||
FcValueListPtr v1, v2;
|
||||
|
||||
for (v1 = v1orig; v1 != NULL; v1 = FcValueListNext(v1))
|
||||
{
|
||||
for (v2 = v2orig; v2 != NULL; v2 = FcValueListNext(v2))
|
||||
if (FcValueEqual (FcValueCanonicalize(&(v1)->value),
|
||||
FcValueCanonicalize(&(v2)->value)))
|
||||
break;
|
||||
if (v2 == NULL)
|
||||
return FcFalse;
|
||||
}
|
||||
for (v2 = v2orig; v2 != NULL; v2 = FcValueListNext(v2))
|
||||
{
|
||||
for (v1 = v1orig; v1 != NULL; v1 = FcValueListNext(v1))
|
||||
if (FcValueEqual (FcValueCanonicalize(&v1->value),
|
||||
FcValueCanonicalize(&v2->value)))
|
||||
break;
|
||||
if (v1 == NULL)
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
static FcBool
|
||||
FcListPatternEqual (FcPattern *p1,
|
||||
FcPattern *p2,
|
||||
FcObjectSet *os)
|
||||
{
|
||||
int i;
|
||||
FcPatternElt *e1, *e2;
|
||||
|
||||
for (i = 0; i < os->nobject; i++)
|
||||
{
|
||||
e1 = FcPatternObjectFindElt (p1, FcObjectFromName (os->objects[i]));
|
||||
e2 = FcPatternObjectFindElt (p2, FcObjectFromName (os->objects[i]));
|
||||
if (!e1 && !e2)
|
||||
continue;
|
||||
if (!e1 || !e2)
|
||||
return FcFalse;
|
||||
if (!FcListValueListEqual (FcPatternEltValues(e1),
|
||||
FcPatternEltValues(e2)))
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
/*
|
||||
* FcTrue iff all objects in "p" match "font"
|
||||
*/
|
||||
|
||||
FcBool
|
||||
FcListPatternMatchAny (const FcPattern *p,
|
||||
const FcPattern *font)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!p)
|
||||
return FcFalse;
|
||||
for (i = 0; i < p->num; i++)
|
||||
{
|
||||
FcPatternElt *pe = &FcPatternElts(p)[i];
|
||||
FcPatternElt *fe;
|
||||
|
||||
if (pe->object == FC_NAMELANG_OBJECT)
|
||||
{
|
||||
/* "namelang" object is the alias object to change "familylang",
|
||||
* "stylelang" and "fullnamelang" object alltogether. it won't be
|
||||
* available on the font pattern. so checking its availability
|
||||
* causes no results. we should ignore it here.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
fe = FcPatternObjectFindElt (font, pe->object);
|
||||
if (!fe)
|
||||
return FcFalse;
|
||||
if (!FcListValueListMatchAny (FcPatternEltValues(pe), /* pat elts */
|
||||
FcPatternEltValues(fe))) /* font elts */
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
static FcChar32
|
||||
FcListMatrixHash (const FcMatrix *m)
|
||||
{
|
||||
int xx = (int) (m->xx * 100),
|
||||
xy = (int) (m->xy * 100),
|
||||
yx = (int) (m->yx * 100),
|
||||
yy = (int) (m->yy * 100);
|
||||
|
||||
return ((FcChar32) xx) ^ ((FcChar32) xy) ^ ((FcChar32) yx) ^ ((FcChar32) yy);
|
||||
}
|
||||
|
||||
static FcChar32
|
||||
FcListValueHash (FcValue *value)
|
||||
{
|
||||
FcValue v = FcValueCanonicalize(value);
|
||||
switch (v.type) {
|
||||
case FcTypeUnknown:
|
||||
case FcTypeVoid:
|
||||
return 0;
|
||||
case FcTypeInteger:
|
||||
return (FcChar32) v.u.i;
|
||||
case FcTypeDouble:
|
||||
return (FcChar32) (int) v.u.d;
|
||||
case FcTypeString:
|
||||
return FcStrHashIgnoreCase (v.u.s);
|
||||
case FcTypeBool:
|
||||
return (FcChar32) v.u.b;
|
||||
case FcTypeMatrix:
|
||||
return FcListMatrixHash (v.u.m);
|
||||
case FcTypeCharSet:
|
||||
return FcCharSetCount (v.u.c);
|
||||
case FcTypeFTFace:
|
||||
return (long) v.u.f;
|
||||
case FcTypeLangSet:
|
||||
return FcLangSetHash (v.u.l);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static FcChar32
|
||||
FcListValueListHash (FcValueListPtr list)
|
||||
{
|
||||
FcChar32 h = 0;
|
||||
|
||||
while (list != NULL)
|
||||
{
|
||||
h = h ^ FcListValueHash (&list->value);
|
||||
list = FcValueListNext(list);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
static FcChar32
|
||||
FcListPatternHash (FcPattern *font,
|
||||
FcObjectSet *os)
|
||||
{
|
||||
int n;
|
||||
FcPatternElt *e;
|
||||
FcChar32 h = 0;
|
||||
|
||||
for (n = 0; n < os->nobject; n++)
|
||||
{
|
||||
e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[n]));
|
||||
if (e)
|
||||
h = h ^ FcListValueListHash (FcPatternEltValues(e));
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
typedef struct _FcListBucket {
|
||||
struct _FcListBucket *next;
|
||||
FcChar32 hash;
|
||||
FcPattern *pattern;
|
||||
} FcListBucket;
|
||||
|
||||
#define FC_LIST_HASH_SIZE 4099
|
||||
|
||||
typedef struct _FcListHashTable {
|
||||
int entries;
|
||||
FcListBucket *buckets[FC_LIST_HASH_SIZE];
|
||||
} FcListHashTable;
|
||||
|
||||
static void
|
||||
FcListHashTableInit (FcListHashTable *table)
|
||||
{
|
||||
table->entries = 0;
|
||||
memset (table->buckets, '\0', sizeof (table->buckets));
|
||||
}
|
||||
|
||||
static void
|
||||
FcListHashTableCleanup (FcListHashTable *table)
|
||||
{
|
||||
int i;
|
||||
FcListBucket *bucket, *next;
|
||||
|
||||
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
|
||||
{
|
||||
for (bucket = table->buckets[i]; bucket; bucket = next)
|
||||
{
|
||||
next = bucket->next;
|
||||
FcPatternDestroy (bucket->pattern);
|
||||
free (bucket);
|
||||
}
|
||||
table->buckets[i] = 0;
|
||||
}
|
||||
table->entries = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
FcGetDefaultObjectLangIndex (FcPattern *font, FcObject object, const FcChar8 *lang)
|
||||
{
|
||||
FcPatternElt *e = FcPatternObjectFindElt (font, object);
|
||||
FcValueListPtr v;
|
||||
FcValue value;
|
||||
int idx = -1;
|
||||
int defidx = -1;
|
||||
int i;
|
||||
|
||||
if (e)
|
||||
{
|
||||
for (v = FcPatternEltValues(e), i = 0; v; v = FcValueListNext(v), ++i)
|
||||
{
|
||||
value = FcValueCanonicalize (&v->value);
|
||||
|
||||
if (value.type == FcTypeString)
|
||||
{
|
||||
FcLangResult res = FcLangCompare (value.u.s, lang);
|
||||
if (res == FcLangEqual)
|
||||
return i;
|
||||
|
||||
if (res == FcLangDifferentCountry && idx < 0)
|
||||
idx = i;
|
||||
if (defidx < 0)
|
||||
{
|
||||
/* workaround for fonts that has non-English value
|
||||
* at the head of values.
|
||||
*/
|
||||
res = FcLangCompare (value.u.s, (FcChar8 *)"en");
|
||||
if (res == FcLangEqual)
|
||||
defidx = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (idx > 0) ? idx : (defidx > 0) ? defidx : 0;
|
||||
}
|
||||
|
||||
static FcBool
|
||||
FcListAppend (FcListHashTable *table,
|
||||
FcPattern *font,
|
||||
FcObjectSet *os,
|
||||
const FcChar8 *lang)
|
||||
{
|
||||
int o;
|
||||
FcPatternElt *e;
|
||||
FcValueListPtr v;
|
||||
FcChar32 hash;
|
||||
FcListBucket **prev, *bucket;
|
||||
int familyidx = -1;
|
||||
int fullnameidx = -1;
|
||||
int styleidx = -1;
|
||||
int defidx = 0;
|
||||
int idx;
|
||||
|
||||
hash = FcListPatternHash (font, os);
|
||||
for (prev = &table->buckets[hash % FC_LIST_HASH_SIZE];
|
||||
(bucket = *prev); prev = &(bucket->next))
|
||||
{
|
||||
if (bucket->hash == hash &&
|
||||
FcListPatternEqual (bucket->pattern, font, os))
|
||||
return FcTrue;
|
||||
}
|
||||
bucket = (FcListBucket *) malloc (sizeof (FcListBucket));
|
||||
if (!bucket)
|
||||
goto bail0;
|
||||
bucket->next = 0;
|
||||
bucket->hash = hash;
|
||||
bucket->pattern = FcPatternCreate ();
|
||||
if (!bucket->pattern)
|
||||
goto bail1;
|
||||
|
||||
for (o = 0; o < os->nobject; o++)
|
||||
{
|
||||
if (!strcmp (os->objects[o], FC_FAMILY) || !strcmp (os->objects[o], FC_FAMILYLANG))
|
||||
{
|
||||
if (familyidx < 0)
|
||||
familyidx = FcGetDefaultObjectLangIndex (font, FC_FAMILYLANG_OBJECT, lang);
|
||||
defidx = familyidx;
|
||||
}
|
||||
else if (!strcmp (os->objects[o], FC_FULLNAME) || !strcmp (os->objects[o], FC_FULLNAMELANG))
|
||||
{
|
||||
if (fullnameidx < 0)
|
||||
fullnameidx = FcGetDefaultObjectLangIndex (font, FC_FULLNAMELANG_OBJECT, lang);
|
||||
defidx = fullnameidx;
|
||||
}
|
||||
else if (!strcmp (os->objects[o], FC_STYLE) || !strcmp (os->objects[o], FC_STYLELANG))
|
||||
{
|
||||
if (styleidx < 0)
|
||||
styleidx = FcGetDefaultObjectLangIndex (font, FC_STYLELANG_OBJECT, lang);
|
||||
defidx = styleidx;
|
||||
}
|
||||
else
|
||||
defidx = 0;
|
||||
|
||||
e = FcPatternObjectFindElt (font, FcObjectFromName (os->objects[o]));
|
||||
if (e)
|
||||
{
|
||||
for (v = FcPatternEltValues(e), idx = 0; v;
|
||||
v = FcValueListNext(v), ++idx)
|
||||
{
|
||||
if (!FcPatternAdd (bucket->pattern,
|
||||
os->objects[o],
|
||||
FcValueCanonicalize(&v->value), defidx != idx))
|
||||
goto bail2;
|
||||
}
|
||||
}
|
||||
}
|
||||
*prev = bucket;
|
||||
++table->entries;
|
||||
|
||||
return FcTrue;
|
||||
|
||||
bail2:
|
||||
FcPatternDestroy (bucket->pattern);
|
||||
bail1:
|
||||
free (bucket);
|
||||
bail0:
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcFontSet *
|
||||
FcFontSetList (FcConfig *config,
|
||||
FcFontSet **sets,
|
||||
int nsets,
|
||||
FcPattern *p,
|
||||
FcObjectSet *os)
|
||||
{
|
||||
FcFontSet *ret;
|
||||
FcFontSet *s;
|
||||
int f;
|
||||
int set;
|
||||
FcListHashTable table;
|
||||
int i;
|
||||
FcListBucket *bucket;
|
||||
int destroy_os = 0;
|
||||
|
||||
if (!config)
|
||||
{
|
||||
if (!FcInitBringUptoDate ())
|
||||
goto bail0;
|
||||
|
||||
config = FcConfigGetCurrent ();
|
||||
if (!config)
|
||||
goto bail0;
|
||||
}
|
||||
FcListHashTableInit (&table);
|
||||
|
||||
if (!os)
|
||||
{
|
||||
os = FcObjectGetSet ();
|
||||
destroy_os = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk all available fonts adding those that
|
||||
* match to the hash table
|
||||
*/
|
||||
for (set = 0; set < nsets; set++)
|
||||
{
|
||||
s = sets[set];
|
||||
if (!s)
|
||||
continue;
|
||||
for (f = 0; f < s->nfont; f++)
|
||||
if (FcListPatternMatchAny (p, /* pattern */
|
||||
s->fonts[f])) /* font */
|
||||
{
|
||||
FcChar8 *lang;
|
||||
|
||||
if (FcPatternObjectGetString (p, FC_NAMELANG_OBJECT, 0, &lang) != FcResultMatch)
|
||||
{
|
||||
lang = FcGetDefaultLang ();
|
||||
}
|
||||
if (!FcListAppend (&table, s->fonts[f], os, lang))
|
||||
goto bail1;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
{
|
||||
int max = 0;
|
||||
int full = 0;
|
||||
int ents = 0;
|
||||
int len;
|
||||
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
|
||||
{
|
||||
if ((bucket = table.buckets[i]))
|
||||
{
|
||||
len = 0;
|
||||
for (; bucket; bucket = bucket->next)
|
||||
{
|
||||
ents++;
|
||||
len++;
|
||||
}
|
||||
if (len > max)
|
||||
max = len;
|
||||
full++;
|
||||
}
|
||||
}
|
||||
printf ("used: %d max: %d avg: %g\n", full, max,
|
||||
(double) ents / FC_LIST_HASH_SIZE);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Walk the hash table and build
|
||||
* a font set
|
||||
*/
|
||||
ret = FcFontSetCreate ();
|
||||
if (!ret)
|
||||
goto bail0;
|
||||
for (i = 0; i < FC_LIST_HASH_SIZE; i++)
|
||||
while ((bucket = table.buckets[i]))
|
||||
{
|
||||
if (!FcFontSetAdd (ret, bucket->pattern))
|
||||
goto bail2;
|
||||
table.buckets[i] = bucket->next;
|
||||
free (bucket);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
bail2:
|
||||
FcFontSetDestroy (ret);
|
||||
bail1:
|
||||
FcListHashTableCleanup (&table);
|
||||
bail0:
|
||||
if (destroy_os)
|
||||
FcObjectSetDestroy (os);
|
||||
return 0;
|
||||
}
|
||||
|
||||
FcFontSet *
|
||||
FcFontList (FcConfig *config,
|
||||
FcPattern *p,
|
||||
FcObjectSet *os)
|
||||
{
|
||||
FcFontSet *sets[2];
|
||||
int nsets;
|
||||
|
||||
if (!config)
|
||||
{
|
||||
if (!FcInitBringUptoDate ())
|
||||
return 0;
|
||||
|
||||
config = FcConfigGetCurrent ();
|
||||
if (!config)
|
||||
return 0;
|
||||
}
|
||||
nsets = 0;
|
||||
if (config->fonts[FcSetSystem])
|
||||
sets[nsets++] = config->fonts[FcSetSystem];
|
||||
if (config->fonts[FcSetApplication])
|
||||
sets[nsets++] = config->fonts[FcSetApplication];
|
||||
return FcFontSetList (config, sets, nsets, p, os);
|
||||
}
|
||||
#define __fclist__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fclist__
|
||||
1026
project/jni/fontconfig/src/fcmatch.c
Normal file
1026
project/jni/fontconfig/src/fcmatch.c
Normal file
File diff suppressed because it is too large
Load Diff
116
project/jni/fontconfig/src/fcmatrix.c
Normal file
116
project/jni/fontconfig/src/fcmatrix.c
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* fontconfig/src/fcmatrix.c
|
||||
*
|
||||
* Copyright © 2000 Tuomas J. Lukka
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Tuomas Lukka not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Tuomas Lukka makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* TUOMAS LUKKA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL TUOMAS LUKKA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
const FcMatrix FcIdentityMatrix = { 1, 0, 0, 1 };
|
||||
|
||||
FcMatrix *
|
||||
FcMatrixCopy (const FcMatrix *mat)
|
||||
{
|
||||
FcMatrix *r;
|
||||
if(!mat)
|
||||
return 0;
|
||||
r = (FcMatrix *) malloc (sizeof (*r) );
|
||||
if (!r)
|
||||
return 0;
|
||||
*r = *mat;
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
FcMatrixFree (FcMatrix *mat)
|
||||
{
|
||||
if (mat != &FcIdentityMatrix)
|
||||
free (mat);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2)
|
||||
{
|
||||
if(mat1 == mat2) return FcTrue;
|
||||
if(mat1 == 0 || mat2 == 0) return FcFalse;
|
||||
return mat1->xx == mat2->xx &&
|
||||
mat1->xy == mat2->xy &&
|
||||
mat1->yx == mat2->yx &&
|
||||
mat1->yy == mat2->yy;
|
||||
}
|
||||
|
||||
void
|
||||
FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b)
|
||||
{
|
||||
FcMatrix r;
|
||||
|
||||
r.xx = a->xx * b->xx + a->xy * b->yx;
|
||||
r.xy = a->xx * b->xy + a->xy * b->yy;
|
||||
r.yx = a->yx * b->xx + a->yy * b->yx;
|
||||
r.yy = a->yx * b->xy + a->yy * b->yy;
|
||||
*result = r;
|
||||
}
|
||||
|
||||
void
|
||||
FcMatrixRotate (FcMatrix *m, double c, double s)
|
||||
{
|
||||
FcMatrix r;
|
||||
|
||||
/*
|
||||
* X Coordinate system is upside down, swap to make
|
||||
* rotations counterclockwise
|
||||
*/
|
||||
r.xx = c;
|
||||
r.xy = -s;
|
||||
r.yx = s;
|
||||
r.yy = c;
|
||||
FcMatrixMultiply (m, &r, m);
|
||||
}
|
||||
|
||||
void
|
||||
FcMatrixScale (FcMatrix *m, double sx, double sy)
|
||||
{
|
||||
FcMatrix r;
|
||||
|
||||
r.xx = sx;
|
||||
r.xy = 0;
|
||||
r.yx = 0;
|
||||
r.yy = sy;
|
||||
FcMatrixMultiply (m, &r, m);
|
||||
}
|
||||
|
||||
void
|
||||
FcMatrixShear (FcMatrix *m, double sh, double sv)
|
||||
{
|
||||
FcMatrix r;
|
||||
|
||||
r.xx = 1;
|
||||
r.xy = sh;
|
||||
r.yx = sv;
|
||||
r.yy = 1;
|
||||
FcMatrixMultiply (m, &r, m);
|
||||
}
|
||||
#define __fcmatrix__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcmatrix__
|
||||
127
project/jni/fontconfig/src/fcmutex.h
Normal file
127
project/jni/fontconfig/src/fcmutex.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Atomic int and pointer operations. Originally copied from HarfBuzz.
|
||||
*
|
||||
* Copyright © 2007 Chris Wilson
|
||||
* Copyright © 2009,2010 Red Hat, Inc.
|
||||
* Copyright © 2011,2012,2013 Google, Inc.
|
||||
*
|
||||
* Permission is hereby granted, without written agreement and without
|
||||
* license or royalty fees, to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose, provided that the
|
||||
* above copyright notice and the following two paragraphs appear in
|
||||
* all copies of this software.
|
||||
*
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Chris Wilson <chris@chris-wilson.co.uk>
|
||||
* Red Hat Author(s): Behdad Esfahbod
|
||||
* Google Author(s): Behdad Esfahbod
|
||||
*/
|
||||
|
||||
#ifndef _FCMUTEX_H_
|
||||
#define _FCMUTEX_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#define FC_STMT_START do
|
||||
#define FC_STMT_END while (0)
|
||||
|
||||
/* mutex */
|
||||
|
||||
/* We need external help for these */
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
|
||||
|
||||
#include "fcwindows.h"
|
||||
typedef CRITICAL_SECTION fc_mutex_impl_t;
|
||||
#define FC_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 }
|
||||
#define fc_mutex_impl_init(M) InitializeCriticalSection (M)
|
||||
#define fc_mutex_impl_lock(M) EnterCriticalSection (M)
|
||||
#define fc_mutex_impl_unlock(M) LeaveCriticalSection (M)
|
||||
#define fc_mutex_impl_finish(M) DeleteCriticalSection (M)
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && (defined(HAVE_PTHREAD) || defined(__APPLE__))
|
||||
|
||||
#include <pthread.h>
|
||||
typedef pthread_mutex_t fc_mutex_impl_t;
|
||||
#define FC_MUTEX_IMPL_INIT PTHREAD_MUTEX_INITIALIZER
|
||||
#define fc_mutex_impl_init(M) pthread_mutex_init (M, NULL)
|
||||
#define fc_mutex_impl_lock(M) pthread_mutex_lock (M)
|
||||
#define fc_mutex_impl_unlock(M) pthread_mutex_unlock (M)
|
||||
#define fc_mutex_impl_finish(M) pthread_mutex_destroy (M)
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
|
||||
|
||||
#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)
|
||||
# include <sched.h>
|
||||
# define FC_SCHED_YIELD() sched_yield ()
|
||||
#else
|
||||
# define FC_SCHED_YIELD() FC_STMT_START {} FC_STMT_END
|
||||
#endif
|
||||
|
||||
/* This actually is not a totally awful implementation. */
|
||||
typedef volatile int fc_mutex_impl_t;
|
||||
#define FC_MUTEX_IMPL_INIT 0
|
||||
#define fc_mutex_impl_init(M) *(M) = 0
|
||||
#define fc_mutex_impl_lock(M) FC_STMT_START { while (__sync_lock_test_and_set((M), 1)) FC_SCHED_YIELD (); } FC_STMT_END
|
||||
#define fc_mutex_impl_unlock(M) __sync_lock_release (M)
|
||||
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
|
||||
|
||||
|
||||
#elif !defined(FC_NO_MT)
|
||||
|
||||
#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_YIELD)
|
||||
# include <sched.h>
|
||||
# define FC_SCHED_YIELD() sched_yield ()
|
||||
#else
|
||||
# define FC_SCHED_YIELD() FC_STMT_START {} FC_STMT_END
|
||||
#endif
|
||||
|
||||
#define FC_MUTEX_INT_NIL 1 /* Warn that fallback implementation is in use. */
|
||||
typedef volatile int fc_mutex_impl_t;
|
||||
#define FC_MUTEX_IMPL_INIT 0
|
||||
#define fc_mutex_impl_init(M) *(M) = 0
|
||||
#define fc_mutex_impl_lock(M) FC_STMT_START { while (*(M)) FC_SCHED_YIELD (); (*(M))++; } FC_STMT_END
|
||||
#define fc_mutex_impl_unlock(M) (*(M))--;
|
||||
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
|
||||
|
||||
|
||||
#else /* FC_NO_MT */
|
||||
|
||||
typedef int fc_mutex_impl_t;
|
||||
#define FC_MUTEX_IMPL_INIT 0
|
||||
#define fc_mutex_impl_init(M) FC_STMT_START {} FC_STMT_END
|
||||
#define fc_mutex_impl_lock(M) FC_STMT_START {} FC_STMT_END
|
||||
#define fc_mutex_impl_unlock(M) FC_STMT_START {} FC_STMT_END
|
||||
#define fc_mutex_impl_finish(M) FC_STMT_START {} FC_STMT_END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define FC_MUTEX_INIT {FC_MUTEX_IMPL_INIT}
|
||||
typedef fc_mutex_impl_t FcMutex;
|
||||
static inline void FcMutexInit (FcMutex *m) { fc_mutex_impl_init (m); }
|
||||
static inline void FcMutexLock (FcMutex *m) { fc_mutex_impl_lock (m); }
|
||||
static inline void FcMutexUnlock (FcMutex *m) { fc_mutex_impl_unlock (m); }
|
||||
static inline void FcMutexFinish (FcMutex *m) { fc_mutex_impl_finish (m); }
|
||||
|
||||
|
||||
#endif /* _FCMUTEX_H_ */
|
||||
586
project/jni/fontconfig/src/fcname.c
Normal file
586
project/jni/fontconfig/src/fcname.c
Normal file
@@ -0,0 +1,586 @@
|
||||
/*
|
||||
* fontconfig/src/fcname.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static const FcObjectType FcObjects[] = {
|
||||
#define FC_OBJECT(NAME, Type, Cmp) { FC_##NAME, Type },
|
||||
#include "fcobjs.h"
|
||||
#undef FC_OBJECT
|
||||
};
|
||||
|
||||
#define NUM_OBJECT_TYPES ((int) (sizeof FcObjects / sizeof FcObjects[0]))
|
||||
|
||||
static const FcObjectType *
|
||||
FcObjectFindById (FcObject object)
|
||||
{
|
||||
if (1 <= object && object <= NUM_OBJECT_TYPES)
|
||||
return &FcObjects[object - 1];
|
||||
return FcObjectLookupOtherTypeById (object);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameRegisterObjectTypes (const FcObjectType *types, int ntypes)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameUnregisterObjectTypes (const FcObjectType *types, int ntypes)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
const FcObjectType *
|
||||
FcNameGetObjectType (const char *object)
|
||||
{
|
||||
int id = FcObjectLookupBuiltinIdByName (object);
|
||||
|
||||
if (!id)
|
||||
return FcObjectLookupOtherTypeByName (object);
|
||||
|
||||
return &FcObjects[id - 1];
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcObjectValidType (FcObject object, FcType type)
|
||||
{
|
||||
const FcObjectType *t = FcObjectFindById (object);
|
||||
|
||||
if (t) {
|
||||
switch ((int) t->type) {
|
||||
case FcTypeUnknown:
|
||||
return FcTrue;
|
||||
case FcTypeDouble:
|
||||
case FcTypeInteger:
|
||||
if (type == FcTypeDouble || type == FcTypeInteger)
|
||||
return FcTrue;
|
||||
break;
|
||||
case FcTypeLangSet:
|
||||
if (type == FcTypeLangSet || type == FcTypeString)
|
||||
return FcTrue;
|
||||
break;
|
||||
default:
|
||||
if (type == t->type)
|
||||
return FcTrue;
|
||||
break;
|
||||
}
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcObject
|
||||
FcObjectFromName (const char * name)
|
||||
{
|
||||
return FcObjectLookupIdByName (name);
|
||||
}
|
||||
|
||||
FcObjectSet *
|
||||
FcObjectGetSet (void)
|
||||
{
|
||||
int i;
|
||||
FcObjectSet *os = NULL;
|
||||
|
||||
|
||||
os = FcObjectSetCreate ();
|
||||
for (i = 0; i < NUM_OBJECT_TYPES; i++)
|
||||
FcObjectSetAdd (os, FcObjects[i].object);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
const char *
|
||||
FcObjectName (FcObject object)
|
||||
{
|
||||
const FcObjectType *o = FcObjectFindById (object);
|
||||
|
||||
if (o)
|
||||
return o->object;
|
||||
|
||||
return FcObjectLookupOtherNameById (object);
|
||||
}
|
||||
|
||||
static const FcConstant _FcBaseConstants[] = {
|
||||
{ (FcChar8 *) "thin", "weight", FC_WEIGHT_THIN, },
|
||||
{ (FcChar8 *) "extralight", "weight", FC_WEIGHT_EXTRALIGHT, },
|
||||
{ (FcChar8 *) "ultralight", "weight", FC_WEIGHT_EXTRALIGHT, },
|
||||
{ (FcChar8 *) "light", "weight", FC_WEIGHT_LIGHT, },
|
||||
{ (FcChar8 *) "book", "weight", FC_WEIGHT_BOOK, },
|
||||
{ (FcChar8 *) "regular", "weight", FC_WEIGHT_REGULAR, },
|
||||
{ (FcChar8 *) "medium", "weight", FC_WEIGHT_MEDIUM, },
|
||||
{ (FcChar8 *) "demibold", "weight", FC_WEIGHT_DEMIBOLD, },
|
||||
{ (FcChar8 *) "semibold", "weight", FC_WEIGHT_DEMIBOLD, },
|
||||
{ (FcChar8 *) "bold", "weight", FC_WEIGHT_BOLD, },
|
||||
{ (FcChar8 *) "extrabold", "weight", FC_WEIGHT_EXTRABOLD, },
|
||||
{ (FcChar8 *) "ultrabold", "weight", FC_WEIGHT_EXTRABOLD, },
|
||||
{ (FcChar8 *) "black", "weight", FC_WEIGHT_BLACK, },
|
||||
{ (FcChar8 *) "heavy", "weight", FC_WEIGHT_HEAVY, },
|
||||
|
||||
{ (FcChar8 *) "roman", "slant", FC_SLANT_ROMAN, },
|
||||
{ (FcChar8 *) "italic", "slant", FC_SLANT_ITALIC, },
|
||||
{ (FcChar8 *) "oblique", "slant", FC_SLANT_OBLIQUE, },
|
||||
|
||||
{ (FcChar8 *) "ultracondensed", "width", FC_WIDTH_ULTRACONDENSED },
|
||||
{ (FcChar8 *) "extracondensed", "width", FC_WIDTH_EXTRACONDENSED },
|
||||
{ (FcChar8 *) "condensed", "width", FC_WIDTH_CONDENSED },
|
||||
{ (FcChar8 *) "semicondensed", "width", FC_WIDTH_SEMICONDENSED },
|
||||
{ (FcChar8 *) "normal", "width", FC_WIDTH_NORMAL },
|
||||
{ (FcChar8 *) "semiexpanded", "width", FC_WIDTH_SEMIEXPANDED },
|
||||
{ (FcChar8 *) "expanded", "width", FC_WIDTH_EXPANDED },
|
||||
{ (FcChar8 *) "extraexpanded", "width", FC_WIDTH_EXTRAEXPANDED },
|
||||
{ (FcChar8 *) "ultraexpanded", "width", FC_WIDTH_ULTRAEXPANDED },
|
||||
|
||||
{ (FcChar8 *) "proportional", "spacing", FC_PROPORTIONAL, },
|
||||
{ (FcChar8 *) "dual", "spacing", FC_DUAL, },
|
||||
{ (FcChar8 *) "mono", "spacing", FC_MONO, },
|
||||
{ (FcChar8 *) "charcell", "spacing", FC_CHARCELL, },
|
||||
|
||||
{ (FcChar8 *) "unknown", "rgba", FC_RGBA_UNKNOWN },
|
||||
{ (FcChar8 *) "rgb", "rgba", FC_RGBA_RGB, },
|
||||
{ (FcChar8 *) "bgr", "rgba", FC_RGBA_BGR, },
|
||||
{ (FcChar8 *) "vrgb", "rgba", FC_RGBA_VRGB },
|
||||
{ (FcChar8 *) "vbgr", "rgba", FC_RGBA_VBGR },
|
||||
{ (FcChar8 *) "none", "rgba", FC_RGBA_NONE },
|
||||
|
||||
{ (FcChar8 *) "hintnone", "hintstyle", FC_HINT_NONE },
|
||||
{ (FcChar8 *) "hintslight", "hintstyle", FC_HINT_SLIGHT },
|
||||
{ (FcChar8 *) "hintmedium", "hintstyle", FC_HINT_MEDIUM },
|
||||
{ (FcChar8 *) "hintfull", "hintstyle", FC_HINT_FULL },
|
||||
|
||||
{ (FcChar8 *) "antialias", "antialias", FcTrue },
|
||||
{ (FcChar8 *) "hinting", "hinting", FcTrue },
|
||||
{ (FcChar8 *) "verticallayout", "verticallayout", FcTrue },
|
||||
{ (FcChar8 *) "autohint", "autohint", FcTrue },
|
||||
{ (FcChar8 *) "globaladvance", "globaladvance", FcTrue }, /* deprecated */
|
||||
{ (FcChar8 *) "outline", "outline", FcTrue },
|
||||
{ (FcChar8 *) "scalable", "scalable", FcTrue },
|
||||
{ (FcChar8 *) "minspace", "minspace", FcTrue },
|
||||
{ (FcChar8 *) "embolden", "embolden", FcTrue },
|
||||
{ (FcChar8 *) "embeddedbitmap", "embeddedbitmap", FcTrue },
|
||||
{ (FcChar8 *) "decorative", "decorative", FcTrue },
|
||||
{ (FcChar8 *) "lcdnone", "lcdfilter", FC_LCD_NONE },
|
||||
{ (FcChar8 *) "lcddefault", "lcdfilter", FC_LCD_DEFAULT },
|
||||
{ (FcChar8 *) "lcdlight", "lcdfilter", FC_LCD_LIGHT },
|
||||
{ (FcChar8 *) "lcdlegacy", "lcdfilter", FC_LCD_LEGACY },
|
||||
};
|
||||
|
||||
#define NUM_FC_CONSTANTS (sizeof _FcBaseConstants/sizeof _FcBaseConstants[0])
|
||||
|
||||
FcBool
|
||||
FcNameRegisterConstants (const FcConstant *consts, int nconsts)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameUnregisterConstants (const FcConstant *consts, int nconsts)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
const FcConstant *
|
||||
FcNameGetConstant (const FcChar8 *string)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NUM_FC_CONSTANTS; i++)
|
||||
if (!FcStrCmpIgnoreCase (string, _FcBaseConstants[i].name))
|
||||
return &_FcBaseConstants[i];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameConstant (const FcChar8 *string, int *result)
|
||||
{
|
||||
const FcConstant *c;
|
||||
|
||||
if ((c = FcNameGetConstant(string)))
|
||||
{
|
||||
*result = c->value;
|
||||
return FcTrue;
|
||||
}
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameBool (const FcChar8 *v, FcBool *result)
|
||||
{
|
||||
char c0, c1;
|
||||
|
||||
c0 = *v;
|
||||
c0 = FcToLower (c0);
|
||||
if (c0 == 't' || c0 == 'y' || c0 == '1')
|
||||
{
|
||||
*result = FcTrue;
|
||||
return FcTrue;
|
||||
}
|
||||
if (c0 == 'f' || c0 == 'n' || c0 == '0')
|
||||
{
|
||||
*result = FcFalse;
|
||||
return FcTrue;
|
||||
}
|
||||
if (c0 == 'o')
|
||||
{
|
||||
c1 = v[1];
|
||||
c1 = FcToLower (c1);
|
||||
if (c1 == 'n')
|
||||
{
|
||||
*result = FcTrue;
|
||||
return FcTrue;
|
||||
}
|
||||
if (c1 == 'f')
|
||||
{
|
||||
*result = FcFalse;
|
||||
return FcTrue;
|
||||
}
|
||||
}
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
static FcValue
|
||||
FcNameConvert (FcType type, FcChar8 *string)
|
||||
{
|
||||
FcValue v;
|
||||
FcMatrix m;
|
||||
|
||||
v.type = type;
|
||||
switch ((int) v.type) {
|
||||
case FcTypeInteger:
|
||||
if (!FcNameConstant (string, &v.u.i))
|
||||
v.u.i = atoi ((char *) string);
|
||||
break;
|
||||
case FcTypeString:
|
||||
v.u.s = FcStrdup (string);
|
||||
if (!v.u.s)
|
||||
v.type = FcTypeVoid;
|
||||
break;
|
||||
case FcTypeBool:
|
||||
if (!FcNameBool (string, &v.u.b))
|
||||
v.u.b = FcFalse;
|
||||
break;
|
||||
case FcTypeDouble:
|
||||
v.u.d = strtod ((char *) string, 0);
|
||||
break;
|
||||
case FcTypeMatrix:
|
||||
FcMatrixInit (&m);
|
||||
sscanf ((char *) string, "%lg %lg %lg %lg", &m.xx, &m.xy, &m.yx, &m.yy);
|
||||
v.u.m = FcMatrixCopy (&m);
|
||||
break;
|
||||
case FcTypeCharSet:
|
||||
v.u.c = FcNameParseCharSet (string);
|
||||
if (!v.u.c)
|
||||
v.type = FcTypeVoid;
|
||||
break;
|
||||
case FcTypeLangSet:
|
||||
v.u.l = FcNameParseLangSet (string);
|
||||
if (!v.u.l)
|
||||
v.type = FcTypeVoid;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
static const FcChar8 *
|
||||
FcNameFindNext (const FcChar8 *cur, const char *delim, FcChar8 *save, FcChar8 *last)
|
||||
{
|
||||
FcChar8 c;
|
||||
|
||||
while ((c = *cur))
|
||||
{
|
||||
if (!isspace (c))
|
||||
break;
|
||||
++cur;
|
||||
}
|
||||
while ((c = *cur))
|
||||
{
|
||||
if (c == '\\')
|
||||
{
|
||||
++cur;
|
||||
if (!(c = *cur))
|
||||
break;
|
||||
}
|
||||
else if (strchr (delim, c))
|
||||
break;
|
||||
++cur;
|
||||
*save++ = c;
|
||||
}
|
||||
*save = 0;
|
||||
*last = *cur;
|
||||
if (*cur)
|
||||
cur++;
|
||||
return cur;
|
||||
}
|
||||
|
||||
FcPattern *
|
||||
FcNameParse (const FcChar8 *name)
|
||||
{
|
||||
FcChar8 *save;
|
||||
FcPattern *pat;
|
||||
double d;
|
||||
FcChar8 *e;
|
||||
FcChar8 delim;
|
||||
FcValue v;
|
||||
const FcObjectType *t;
|
||||
const FcConstant *c;
|
||||
|
||||
/* freed below */
|
||||
save = malloc (strlen ((char *) name) + 1);
|
||||
if (!save)
|
||||
goto bail0;
|
||||
pat = FcPatternCreate ();
|
||||
if (!pat)
|
||||
goto bail1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
name = FcNameFindNext (name, "-,:", save, &delim);
|
||||
if (save[0])
|
||||
{
|
||||
if (!FcPatternAddString (pat, FC_FAMILY, save))
|
||||
goto bail2;
|
||||
}
|
||||
if (delim != ',')
|
||||
break;
|
||||
}
|
||||
if (delim == '-')
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
name = FcNameFindNext (name, "-,:", save, &delim);
|
||||
d = strtod ((char *) save, (char **) &e);
|
||||
if (e != save)
|
||||
{
|
||||
if (!FcPatternAddDouble (pat, FC_SIZE, d))
|
||||
goto bail2;
|
||||
}
|
||||
if (delim != ',')
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (delim == ':')
|
||||
{
|
||||
name = FcNameFindNext (name, "=_:", save, &delim);
|
||||
if (save[0])
|
||||
{
|
||||
if (delim == '=' || delim == '_')
|
||||
{
|
||||
t = FcNameGetObjectType ((char *) save);
|
||||
for (;;)
|
||||
{
|
||||
name = FcNameFindNext (name, ":,", save, &delim);
|
||||
if (t)
|
||||
{
|
||||
v = FcNameConvert (t->type, save);
|
||||
if (!FcPatternAdd (pat, t->object, v, FcTrue))
|
||||
{
|
||||
FcValueDestroy (v);
|
||||
goto bail2;
|
||||
}
|
||||
FcValueDestroy (v);
|
||||
}
|
||||
if (delim != ',')
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((c = FcNameGetConstant (save)))
|
||||
{
|
||||
t = FcNameGetObjectType ((char *) c->object);
|
||||
if (t == NULL)
|
||||
goto bail2;
|
||||
switch ((int) t->type) {
|
||||
case FcTypeInteger:
|
||||
case FcTypeDouble:
|
||||
if (!FcPatternAddInteger (pat, c->object, c->value))
|
||||
goto bail2;
|
||||
break;
|
||||
case FcTypeBool:
|
||||
if (!FcPatternAddBool (pat, c->object, c->value))
|
||||
goto bail2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free (save);
|
||||
return pat;
|
||||
|
||||
bail2:
|
||||
FcPatternDestroy (pat);
|
||||
bail1:
|
||||
free (save);
|
||||
bail0:
|
||||
return 0;
|
||||
}
|
||||
static FcBool
|
||||
FcNameUnparseString (FcStrBuf *buf,
|
||||
const FcChar8 *string,
|
||||
const FcChar8 *escape)
|
||||
{
|
||||
FcChar8 c;
|
||||
while ((c = *string++))
|
||||
{
|
||||
if (escape && strchr ((char *) escape, (char) c))
|
||||
{
|
||||
if (!FcStrBufChar (buf, escape[0]))
|
||||
return FcFalse;
|
||||
}
|
||||
if (!FcStrBufChar (buf, c))
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameUnparseValue (FcStrBuf *buf,
|
||||
FcValue *v0,
|
||||
FcChar8 *escape)
|
||||
{
|
||||
FcChar8 temp[1024];
|
||||
FcValue v = FcValueCanonicalize(v0);
|
||||
|
||||
switch (v.type) {
|
||||
case FcTypeUnknown:
|
||||
case FcTypeVoid:
|
||||
return FcTrue;
|
||||
case FcTypeInteger:
|
||||
sprintf ((char *) temp, "%d", v.u.i);
|
||||
return FcNameUnparseString (buf, temp, 0);
|
||||
case FcTypeDouble:
|
||||
sprintf ((char *) temp, "%g", v.u.d);
|
||||
return FcNameUnparseString (buf, temp, 0);
|
||||
case FcTypeString:
|
||||
return FcNameUnparseString (buf, v.u.s, escape);
|
||||
case FcTypeBool:
|
||||
return FcNameUnparseString (buf, v.u.b ? (FcChar8 *) "True" : (FcChar8 *) "False", 0);
|
||||
case FcTypeMatrix:
|
||||
sprintf ((char *) temp, "%g %g %g %g",
|
||||
v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
|
||||
return FcNameUnparseString (buf, temp, 0);
|
||||
case FcTypeCharSet:
|
||||
return FcNameUnparseCharSet (buf, v.u.c);
|
||||
case FcTypeLangSet:
|
||||
return FcNameUnparseLangSet (buf, v.u.l);
|
||||
case FcTypeFTFace:
|
||||
return FcTrue;
|
||||
}
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcNameUnparseValueList (FcStrBuf *buf,
|
||||
FcValueListPtr v,
|
||||
FcChar8 *escape)
|
||||
{
|
||||
while (v)
|
||||
{
|
||||
if (!FcNameUnparseValue (buf, &v->value, escape))
|
||||
return FcFalse;
|
||||
if ((v = FcValueListNext(v)) != NULL)
|
||||
if (!FcNameUnparseString (buf, (FcChar8 *) ",", 0))
|
||||
return FcFalse;
|
||||
}
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
#define FC_ESCAPE_FIXED "\\-:,"
|
||||
#define FC_ESCAPE_VARIABLE "\\=_:,"
|
||||
|
||||
FcChar8 *
|
||||
FcNameUnparse (FcPattern *pat)
|
||||
{
|
||||
return FcNameUnparseEscaped (pat, FcTrue);
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
|
||||
{
|
||||
FcStrBuf buf;
|
||||
FcChar8 buf_static[8192];
|
||||
int i;
|
||||
FcPatternElt *e;
|
||||
|
||||
FcStrBufInit (&buf, buf_static, sizeof (buf_static));
|
||||
e = FcPatternObjectFindElt (pat, FC_FAMILY_OBJECT);
|
||||
if (e)
|
||||
{
|
||||
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
|
||||
goto bail0;
|
||||
}
|
||||
e = FcPatternObjectFindElt (pat, FC_SIZE_OBJECT);
|
||||
if (e)
|
||||
{
|
||||
if (!FcNameUnparseString (&buf, (FcChar8 *) "-", 0))
|
||||
goto bail0;
|
||||
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
|
||||
goto bail0;
|
||||
}
|
||||
for (i = 0; i < NUM_OBJECT_TYPES; i++)
|
||||
{
|
||||
FcObject id = i + 1;
|
||||
const FcObjectType *o;
|
||||
o = &FcObjects[i];
|
||||
if (!strcmp (o->object, FC_FAMILY) ||
|
||||
!strcmp (o->object, FC_SIZE))
|
||||
continue;
|
||||
|
||||
e = FcPatternObjectFindElt (pat, id);
|
||||
if (e)
|
||||
{
|
||||
if (!FcNameUnparseString (&buf, (FcChar8 *) ":", 0))
|
||||
goto bail0;
|
||||
if (!FcNameUnparseString (&buf, (FcChar8 *) o->object, escape ? (FcChar8 *) FC_ESCAPE_VARIABLE : 0))
|
||||
goto bail0;
|
||||
if (!FcNameUnparseString (&buf, (FcChar8 *) "=", 0))
|
||||
goto bail0;
|
||||
if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ?
|
||||
(FcChar8 *) FC_ESCAPE_VARIABLE : 0))
|
||||
goto bail0;
|
||||
}
|
||||
}
|
||||
return FcStrBufDone (&buf);
|
||||
bail0:
|
||||
FcStrBufDestroy (&buf);
|
||||
return 0;
|
||||
}
|
||||
#define __fcname__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcname__
|
||||
139
project/jni/fontconfig/src/fcobjs.c
Normal file
139
project/jni/fontconfig/src/fcobjs.c
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* fontconfig/src/fclist.c
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
|
||||
static unsigned int
|
||||
FcObjectTypeHash (register const char *str, register unsigned int len);
|
||||
|
||||
static const struct FcObjectTypeInfo *
|
||||
FcObjectTypeLookup (register const char *str, register unsigned int len);
|
||||
|
||||
#include "fcobjshash.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* The 1000 is to leave some room for future added internal objects, such
|
||||
* that caches from newer fontconfig can still be used with older fontconfig
|
||||
* without getting confused. */
|
||||
static fc_atomic_int_t next_id = FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX;
|
||||
struct FcObjectOtherTypeInfo {
|
||||
struct FcObjectOtherTypeInfo *next;
|
||||
FcObjectType object;
|
||||
FcObject id;
|
||||
} *other_types;
|
||||
|
||||
static FcObjectType *
|
||||
_FcObjectLookupOtherTypeByName (const char *str, FcObject *id)
|
||||
{
|
||||
struct FcObjectOtherTypeInfo *ots, *ot;
|
||||
|
||||
retry:
|
||||
ots = fc_atomic_ptr_get (&other_types);
|
||||
|
||||
for (ot = ots; ot; ot = ot->next)
|
||||
if (0 == strcmp (ot->object.object, str))
|
||||
break;
|
||||
|
||||
if (!ot)
|
||||
{
|
||||
ot = malloc (sizeof (*ot));
|
||||
if (!ot)
|
||||
return NULL;
|
||||
|
||||
ot->object.object = (const char *) FcStrdup (str);
|
||||
ot->object.type = FcTypeUnknown;
|
||||
ot->id = fc_atomic_int_add (next_id, +1);
|
||||
ot->next = ots;
|
||||
|
||||
if (!fc_atomic_ptr_cmpexch (&other_types, ots, ot)) {
|
||||
free (ot);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
if (id)
|
||||
*id = ot->id;
|
||||
|
||||
return &ot->object;
|
||||
}
|
||||
|
||||
FcObject
|
||||
FcObjectLookupBuiltinIdByName (const char *str)
|
||||
{
|
||||
const struct FcObjectTypeInfo *o = FcObjectTypeLookup (str, strlen (str));
|
||||
|
||||
if (o)
|
||||
return o->id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
FcObject
|
||||
FcObjectLookupIdByName (const char *str)
|
||||
{
|
||||
const struct FcObjectTypeInfo *o = FcObjectTypeLookup (str, strlen (str));
|
||||
FcObject id;
|
||||
if (o)
|
||||
return o->id;
|
||||
|
||||
if (_FcObjectLookupOtherTypeByName (str, &id))
|
||||
return id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *
|
||||
FcObjectLookupOtherNameById (FcObject id)
|
||||
{
|
||||
struct FcObjectOtherTypeInfo *ot;
|
||||
|
||||
for (ot = fc_atomic_ptr_get (&other_types); ot; ot = ot->next)
|
||||
if (ot->id == id)
|
||||
return ot->object.object;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const FcObjectType *
|
||||
FcObjectLookupOtherTypeByName (const char *str)
|
||||
{
|
||||
return _FcObjectLookupOtherTypeByName (str, NULL);
|
||||
}
|
||||
|
||||
FcPrivate const FcObjectType *
|
||||
FcObjectLookupOtherTypeById (FcObject id)
|
||||
{
|
||||
struct FcObjectOtherTypeInfo *ot;
|
||||
|
||||
for (ot = fc_atomic_ptr_get (&other_types); ot; ot = ot->next)
|
||||
if (ot->id == id)
|
||||
return &ot->object;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcobjs__
|
||||
71
project/jni/fontconfig/src/fcobjs.h
Normal file
71
project/jni/fontconfig/src/fcobjs.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* fontconfig/src/fcobjs.h
|
||||
*
|
||||
* Copyright © 2000 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
/* DON'T REORDER! The order is part of the cache signature. */
|
||||
FC_OBJECT (FAMILY, FcTypeString, FcCompareFamily)
|
||||
FC_OBJECT (FAMILYLANG, FcTypeString, NULL)
|
||||
FC_OBJECT (STYLE, FcTypeString, FcCompareString)
|
||||
FC_OBJECT (STYLELANG, FcTypeString, NULL)
|
||||
FC_OBJECT (FULLNAME, FcTypeString, NULL)
|
||||
FC_OBJECT (FULLNAMELANG, FcTypeString, NULL)
|
||||
FC_OBJECT (SLANT, FcTypeInteger, FcCompareNumber)
|
||||
FC_OBJECT (WEIGHT, FcTypeInteger, FcCompareNumber)
|
||||
FC_OBJECT (WIDTH, FcTypeInteger, FcCompareNumber)
|
||||
FC_OBJECT (SIZE, FcTypeDouble, NULL)
|
||||
FC_OBJECT (ASPECT, FcTypeDouble, NULL)
|
||||
FC_OBJECT (PIXEL_SIZE, FcTypeDouble, FcCompareSize)
|
||||
FC_OBJECT (SPACING, FcTypeInteger, FcCompareNumber)
|
||||
FC_OBJECT (FOUNDRY, FcTypeString, FcCompareString)
|
||||
FC_OBJECT (ANTIALIAS, FcTypeBool, FcCompareBool)
|
||||
FC_OBJECT (HINT_STYLE, FcTypeInteger, NULL)
|
||||
FC_OBJECT (HINTING, FcTypeBool, NULL)
|
||||
FC_OBJECT (VERTICAL_LAYOUT, FcTypeBool, NULL)
|
||||
FC_OBJECT (AUTOHINT, FcTypeBool, NULL)
|
||||
FC_OBJECT (GLOBAL_ADVANCE, FcTypeBool, NULL) /* deprecated */
|
||||
FC_OBJECT (FILE, FcTypeString, FcCompareFilename)
|
||||
FC_OBJECT (INDEX, FcTypeInteger, NULL)
|
||||
FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString)
|
||||
FC_OBJECT (OUTLINE, FcTypeBool, FcCompareBool)
|
||||
FC_OBJECT (SCALABLE, FcTypeBool, FcCompareBool)
|
||||
FC_OBJECT (DPI, FcTypeDouble, NULL)
|
||||
FC_OBJECT (RGBA, FcTypeInteger, NULL)
|
||||
FC_OBJECT (SCALE, FcTypeDouble, NULL)
|
||||
FC_OBJECT (MINSPACE, FcTypeBool, NULL)
|
||||
FC_OBJECT (CHAR_WIDTH, FcTypeInteger, NULL)
|
||||
FC_OBJECT (CHAR_HEIGHT, FcTypeInteger, NULL)
|
||||
FC_OBJECT (MATRIX, FcTypeMatrix, NULL)
|
||||
FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet)
|
||||
FC_OBJECT (LANG, FcTypeLangSet, FcCompareLang)
|
||||
FC_OBJECT (FONTVERSION, FcTypeInteger, FcCompareNumber)
|
||||
FC_OBJECT (CAPABILITY, FcTypeString, NULL)
|
||||
FC_OBJECT (FONTFORMAT, FcTypeString, FcCompareString)
|
||||
FC_OBJECT (EMBOLDEN, FcTypeBool, NULL)
|
||||
FC_OBJECT (EMBEDDED_BITMAP, FcTypeBool, NULL)
|
||||
FC_OBJECT (DECORATIVE, FcTypeBool, FcCompareBool)
|
||||
FC_OBJECT (LCD_FILTER, FcTypeInteger, NULL)
|
||||
FC_OBJECT (NAMELANG, FcTypeString, NULL)
|
||||
FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
|
||||
FC_OBJECT (PRGNAME, FcTypeString, NULL)
|
||||
FC_OBJECT (HASH, FcTypeString, FcCompareHash)
|
||||
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
|
||||
/* ^-------------- Add new objects here. */
|
||||
317
project/jni/fontconfig/src/fcobjshash.h
Normal file
317
project/jni/fontconfig/src/fcobjshash.h
Normal file
@@ -0,0 +1,317 @@
|
||||
/* ANSI-C code produced by gperf version 3.0.3 */
|
||||
/* Command-line: gperf -m 100 fcobjshash.gperf */
|
||||
/* Computed positions: -k'2-3' */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
||||
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
||||
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
||||
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
||||
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
||||
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
||||
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
||||
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
||||
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
||||
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
||||
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
||||
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
||||
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
||||
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
||||
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
||||
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
||||
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
||||
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
||||
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
||||
/* The character set is not based on ISO-646. */
|
||||
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
||||
#endif
|
||||
|
||||
#line 1 "fcobjshash.gperf"
|
||||
|
||||
#line 13 "fcobjshash.gperf"
|
||||
struct FcObjectTypeInfo {
|
||||
int name;
|
||||
int id;
|
||||
};
|
||||
#include <string.h>
|
||||
/* maximum key range = 52, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
inline
|
||||
#endif
|
||||
#endif
|
||||
static unsigned int
|
||||
FcObjectTypeHash (register const char *str, register unsigned int len)
|
||||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 17, 12, 1,
|
||||
35, 0, 56, 27, 15, 0, 56, 56, 0, 7,
|
||||
7, 0, 22, 56, 21, 10, 13, 0, 56, 56,
|
||||
0, 26, 1, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
||||
56, 56, 56, 56, 56, 56
|
||||
};
|
||||
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[1]];
|
||||
}
|
||||
|
||||
struct FcObjectTypeNamePool_t
|
||||
{
|
||||
char FcObjectTypeNamePool_str4[sizeof("file")];
|
||||
char FcObjectTypeNamePool_str5[sizeof("size")];
|
||||
char FcObjectTypeNamePool_str6[sizeof("weight")];
|
||||
char FcObjectTypeNamePool_str7[sizeof("foundry")];
|
||||
char FcObjectTypeNamePool_str8[sizeof("fullname")];
|
||||
char FcObjectTypeNamePool_str9[sizeof("pixelsize")];
|
||||
char FcObjectTypeNamePool_str11[sizeof("decorative")];
|
||||
char FcObjectTypeNamePool_str12[sizeof("fullnamelang")];
|
||||
char FcObjectTypeNamePool_str13[sizeof("globaladvance")];
|
||||
char FcObjectTypeNamePool_str14[sizeof("hinting")];
|
||||
char FcObjectTypeNamePool_str15[sizeof("minspace")];
|
||||
char FcObjectTypeNamePool_str16[sizeof("hintstyle")];
|
||||
char FcObjectTypeNamePool_str17[sizeof("fontformat")];
|
||||
char FcObjectTypeNamePool_str18[sizeof("fontversion")];
|
||||
char FcObjectTypeNamePool_str19[sizeof("fontfeatures")];
|
||||
char FcObjectTypeNamePool_str20[sizeof("outline")];
|
||||
char FcObjectTypeNamePool_str21[sizeof("autohint")];
|
||||
char FcObjectTypeNamePool_str22[sizeof("slant")];
|
||||
char FcObjectTypeNamePool_str23[sizeof("scale")];
|
||||
char FcObjectTypeNamePool_str24[sizeof("postscriptname")];
|
||||
char FcObjectTypeNamePool_str25[sizeof("dpi")];
|
||||
char FcObjectTypeNamePool_str26[sizeof("scalable")];
|
||||
char FcObjectTypeNamePool_str27[sizeof("embolden")];
|
||||
char FcObjectTypeNamePool_str28[sizeof("lang")];
|
||||
char FcObjectTypeNamePool_str29[sizeof("antialias")];
|
||||
char FcObjectTypeNamePool_str30[sizeof("family")];
|
||||
char FcObjectTypeNamePool_str31[sizeof("hash")];
|
||||
char FcObjectTypeNamePool_str32[sizeof("namelang")];
|
||||
char FcObjectTypeNamePool_str33[sizeof("embeddedbitmap")];
|
||||
char FcObjectTypeNamePool_str34[sizeof("familylang")];
|
||||
char FcObjectTypeNamePool_str35[sizeof("verticallayout")];
|
||||
char FcObjectTypeNamePool_str36[sizeof("matrix")];
|
||||
char FcObjectTypeNamePool_str37[sizeof("rasterizer")];
|
||||
char FcObjectTypeNamePool_str38[sizeof("aspect")];
|
||||
char FcObjectTypeNamePool_str39[sizeof("charset")];
|
||||
char FcObjectTypeNamePool_str40[sizeof("width")];
|
||||
char FcObjectTypeNamePool_str41[sizeof("charwidth")];
|
||||
char FcObjectTypeNamePool_str42[sizeof("charheight")];
|
||||
char FcObjectTypeNamePool_str43[sizeof("rgba")];
|
||||
char FcObjectTypeNamePool_str44[sizeof("style")];
|
||||
char FcObjectTypeNamePool_str45[sizeof("lcdfilter")];
|
||||
char FcObjectTypeNamePool_str46[sizeof("spacing")];
|
||||
char FcObjectTypeNamePool_str47[sizeof("index")];
|
||||
char FcObjectTypeNamePool_str48[sizeof("stylelang")];
|
||||
char FcObjectTypeNamePool_str49[sizeof("capability")];
|
||||
char FcObjectTypeNamePool_str55[sizeof("prgname")];
|
||||
};
|
||||
static const struct FcObjectTypeNamePool_t FcObjectTypeNamePool_contents =
|
||||
{
|
||||
"file",
|
||||
"size",
|
||||
"weight",
|
||||
"foundry",
|
||||
"fullname",
|
||||
"pixelsize",
|
||||
"decorative",
|
||||
"fullnamelang",
|
||||
"globaladvance",
|
||||
"hinting",
|
||||
"minspace",
|
||||
"hintstyle",
|
||||
"fontformat",
|
||||
"fontversion",
|
||||
"fontfeatures",
|
||||
"outline",
|
||||
"autohint",
|
||||
"slant",
|
||||
"scale",
|
||||
"postscriptname",
|
||||
"dpi",
|
||||
"scalable",
|
||||
"embolden",
|
||||
"lang",
|
||||
"antialias",
|
||||
"family",
|
||||
"hash",
|
||||
"namelang",
|
||||
"embeddedbitmap",
|
||||
"familylang",
|
||||
"verticallayout",
|
||||
"matrix",
|
||||
"rasterizer",
|
||||
"aspect",
|
||||
"charset",
|
||||
"width",
|
||||
"charwidth",
|
||||
"charheight",
|
||||
"rgba",
|
||||
"style",
|
||||
"lcdfilter",
|
||||
"spacing",
|
||||
"index",
|
||||
"stylelang",
|
||||
"capability",
|
||||
"prgname"
|
||||
};
|
||||
#define FcObjectTypeNamePool ((const char *) &FcObjectTypeNamePool_contents)
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#ifdef __GNUC_STDC_INLINE__
|
||||
__attribute__ ((__gnu_inline__))
|
||||
#endif
|
||||
#endif
|
||||
const struct FcObjectTypeInfo *
|
||||
FcObjectTypeLookup (register const char *str, register unsigned int len)
|
||||
{
|
||||
enum
|
||||
{
|
||||
TOTAL_KEYWORDS = 46,
|
||||
MIN_WORD_LENGTH = 3,
|
||||
MAX_WORD_LENGTH = 14,
|
||||
MIN_HASH_VALUE = 4,
|
||||
MAX_HASH_VALUE = 55
|
||||
};
|
||||
|
||||
static const struct FcObjectTypeInfo wordlist[] =
|
||||
{
|
||||
{-1}, {-1}, {-1}, {-1},
|
||||
#line 38 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str4,FC_FILE_OBJECT},
|
||||
#line 27 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str5,FC_SIZE_OBJECT},
|
||||
#line 25 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str6,FC_WEIGHT_OBJECT},
|
||||
#line 31 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str7,FC_FOUNDRY_OBJECT},
|
||||
#line 22 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str8,FC_FULLNAME_OBJECT},
|
||||
#line 29 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str9,FC_PIXEL_SIZE_OBJECT},
|
||||
{-1},
|
||||
#line 57 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str11,FC_DECORATIVE_OBJECT},
|
||||
#line 23 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str12,FC_FULLNAMELANG_OBJECT},
|
||||
#line 37 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str13,FC_GLOBAL_ADVANCE_OBJECT},
|
||||
#line 34 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str14,FC_HINTING_OBJECT},
|
||||
#line 46 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str15,FC_MINSPACE_OBJECT},
|
||||
#line 33 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str16,FC_HINT_STYLE_OBJECT},
|
||||
#line 54 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str17,FC_FONTFORMAT_OBJECT},
|
||||
#line 52 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str18,FC_FONTVERSION_OBJECT},
|
||||
#line 60 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str19,FC_FONT_FEATURES_OBJECT},
|
||||
#line 41 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str20,FC_OUTLINE_OBJECT},
|
||||
#line 36 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str21,FC_AUTOHINT_OBJECT},
|
||||
#line 24 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str22,FC_SLANT_OBJECT},
|
||||
#line 45 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str23,FC_SCALE_OBJECT},
|
||||
#line 63 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str24,FC_POSTSCRIPT_NAME_OBJECT},
|
||||
#line 43 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str25,FC_DPI_OBJECT},
|
||||
#line 42 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str26,FC_SCALABLE_OBJECT},
|
||||
#line 55 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str27,FC_EMBOLDEN_OBJECT},
|
||||
#line 51 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str28,FC_LANG_OBJECT},
|
||||
#line 32 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str29,FC_ANTIALIAS_OBJECT},
|
||||
#line 18 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str30,FC_FAMILY_OBJECT},
|
||||
#line 62 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str31,FC_HASH_OBJECT},
|
||||
#line 59 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str32,FC_NAMELANG_OBJECT},
|
||||
#line 56 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str33,FC_EMBEDDED_BITMAP_OBJECT},
|
||||
#line 19 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str34,FC_FAMILYLANG_OBJECT},
|
||||
#line 35 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str35,FC_VERTICAL_LAYOUT_OBJECT},
|
||||
#line 49 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str36,FC_MATRIX_OBJECT},
|
||||
#line 40 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str37,FC_RASTERIZER_OBJECT},
|
||||
#line 28 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str38,FC_ASPECT_OBJECT},
|
||||
#line 50 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str39,FC_CHARSET_OBJECT},
|
||||
#line 26 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str40,FC_WIDTH_OBJECT},
|
||||
#line 47 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str41,FC_CHAR_WIDTH_OBJECT},
|
||||
#line 48 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str42,FC_CHAR_HEIGHT_OBJECT},
|
||||
#line 44 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_RGBA_OBJECT},
|
||||
#line 20 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str44,FC_STYLE_OBJECT},
|
||||
#line 58 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_LCD_FILTER_OBJECT},
|
||||
#line 30 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_SPACING_OBJECT},
|
||||
#line 39 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str47,FC_INDEX_OBJECT},
|
||||
#line 21 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str48,FC_STYLELANG_OBJECT},
|
||||
#line 53 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str49,FC_CAPABILITY_OBJECT},
|
||||
{-1}, {-1}, {-1}, {-1}, {-1},
|
||||
#line 61 "fcobjshash.gperf"
|
||||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str55,FC_PRGNAME_OBJECT}
|
||||
};
|
||||
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = FcObjectTypeHash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register int o = wordlist[key].name;
|
||||
if (o >= 0)
|
||||
{
|
||||
register const char *s = o + FcObjectTypeNamePool;
|
||||
|
||||
if (*str == *s && !strcmp (str + 1, s + 1))
|
||||
return &wordlist[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
1318
project/jni/fontconfig/src/fcpat.c
Normal file
1318
project/jni/fontconfig/src/fcpat.c
Normal file
File diff suppressed because it is too large
Load Diff
155
project/jni/fontconfig/src/fcserialize.c
Normal file
155
project/jni/fontconfig/src/fcserialize.c
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright © 2006 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "fcint.h"
|
||||
|
||||
intptr_t
|
||||
FcAlignSize (intptr_t size)
|
||||
{
|
||||
intptr_t rem = size % sizeof (FcAlign);
|
||||
if (rem)
|
||||
size += sizeof (FcAlign) - rem;
|
||||
return size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serialization helper object -- allocate space in the
|
||||
* yet-to-be-created linear array for a serialized font set
|
||||
*/
|
||||
|
||||
FcSerialize *
|
||||
FcSerializeCreate (void)
|
||||
{
|
||||
FcSerialize *serialize;
|
||||
|
||||
serialize = malloc (sizeof (FcSerialize));
|
||||
if (!serialize)
|
||||
return NULL;
|
||||
serialize->size = 0;
|
||||
serialize->linear = NULL;
|
||||
serialize->cs_freezer = NULL;
|
||||
memset (serialize->buckets, '\0', sizeof (serialize->buckets));
|
||||
return serialize;
|
||||
}
|
||||
|
||||
void
|
||||
FcSerializeDestroy (FcSerialize *serialize)
|
||||
{
|
||||
uintptr_t bucket;
|
||||
|
||||
for (bucket = 0; bucket < FC_SERIALIZE_HASH_SIZE; bucket++)
|
||||
{
|
||||
FcSerializeBucket *buck, *next;
|
||||
|
||||
for (buck = serialize->buckets[bucket]; buck; buck = next) {
|
||||
next = buck->next;
|
||||
free (buck);
|
||||
}
|
||||
}
|
||||
if (serialize->cs_freezer)
|
||||
FcCharSetFreezerDestroy (serialize->cs_freezer);
|
||||
free (serialize);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate space for an object in the serialized array. Keep track
|
||||
* of where the object is placed and only allocate one copy of each object
|
||||
*/
|
||||
|
||||
FcBool
|
||||
FcSerializeAlloc (FcSerialize *serialize, const void *object, int size)
|
||||
{
|
||||
uintptr_t bucket = ((uintptr_t) object) % FC_SERIALIZE_HASH_SIZE;
|
||||
FcSerializeBucket *buck;
|
||||
|
||||
for (buck = serialize->buckets[bucket]; buck; buck = buck->next)
|
||||
if (buck->object == object)
|
||||
return FcTrue;
|
||||
buck = malloc (sizeof (FcSerializeBucket));
|
||||
if (!buck)
|
||||
return FcFalse;
|
||||
buck->object = object;
|
||||
buck->offset = serialize->size;
|
||||
buck->next = serialize->buckets[bucket];
|
||||
serialize->buckets[bucket] = buck;
|
||||
serialize->size += FcAlignSize (size);
|
||||
return FcTrue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reserve space in the serialization array
|
||||
*/
|
||||
intptr_t
|
||||
FcSerializeReserve (FcSerialize *serialize, int size)
|
||||
{
|
||||
intptr_t offset = serialize->size;
|
||||
serialize->size += FcAlignSize (size);
|
||||
return offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given an object, return the offset in the serialized array where
|
||||
* the serialized copy of the object is stored
|
||||
*/
|
||||
intptr_t
|
||||
FcSerializeOffset (FcSerialize *serialize, const void *object)
|
||||
{
|
||||
uintptr_t bucket = ((uintptr_t) object) % FC_SERIALIZE_HASH_SIZE;
|
||||
FcSerializeBucket *buck;
|
||||
|
||||
for (buck = serialize->buckets[bucket]; buck; buck = buck->next)
|
||||
if (buck->object == object)
|
||||
return buck->offset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a cache and an object, return a pointer to where
|
||||
* the serialized copy of the object is stored
|
||||
*/
|
||||
void *
|
||||
FcSerializePtr (FcSerialize *serialize, const void *object)
|
||||
{
|
||||
intptr_t offset = FcSerializeOffset (serialize, object);
|
||||
|
||||
if (!offset)
|
||||
return NULL;
|
||||
return (void *) ((char *) serialize->linear + offset);
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcStrSerializeAlloc (FcSerialize *serialize, const FcChar8 *str)
|
||||
{
|
||||
return FcSerializeAlloc (serialize, str, strlen ((const char *) str) + 1);
|
||||
}
|
||||
|
||||
FcChar8 *
|
||||
FcStrSerialize (FcSerialize *serialize, const FcChar8 *str)
|
||||
{
|
||||
FcChar8 *str_serialize = FcSerializePtr (serialize, str);
|
||||
if (!str_serialize)
|
||||
return NULL;
|
||||
strcpy ((char *) str_serialize, (const char *) str);
|
||||
return str_serialize;
|
||||
}
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcserialize__
|
||||
362
project/jni/fontconfig/src/fcstat.c
Normal file
362
project/jni/fontconfig/src/fcstat.c
Normal file
@@ -0,0 +1,362 @@
|
||||
/*
|
||||
* Copyright © 2000 Keith Packard
|
||||
* Copyright © 2005 Patrick Lam
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "fcint.h"
|
||||
#include "fcarch.h"
|
||||
#include <dirent.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STATVFS_H
|
||||
#include <sys/statvfs.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef __GNUC__
|
||||
typedef long long INT64;
|
||||
#define EPOCH_OFFSET 11644473600ll
|
||||
#else
|
||||
#define EPOCH_OFFSET 11644473600i64
|
||||
typedef __int64 INT64;
|
||||
#endif
|
||||
|
||||
/* Workaround for problems in the stat() in the Microsoft C library:
|
||||
*
|
||||
* 1) stat() uses FindFirstFile() to get the file
|
||||
* attributes. Unfortunately this API doesn't return correct values
|
||||
* for modification time of a directory until some time after a file
|
||||
* or subdirectory has been added to the directory. (This causes
|
||||
* run-test.sh to fail, for instance.) GetFileAttributesEx() is
|
||||
* better, it returns the updated timestamp right away.
|
||||
*
|
||||
* 2) stat() does some strange things related to backward
|
||||
* compatibility with the local time timestamps on FAT volumes and
|
||||
* daylight saving time. This causes problems after the switches
|
||||
* to/from daylight saving time. See
|
||||
* http://bugzilla.gnome.org/show_bug.cgi?id=154968 , especially
|
||||
* comment #30, and http://www.codeproject.com/datetime/dstbugs.asp .
|
||||
* We don't need any of that, FAT and Win9x are as good as dead. So
|
||||
* just use the UTC timestamps from NTFS, converted to the Unix epoch.
|
||||
*/
|
||||
|
||||
int
|
||||
FcStat (const FcChar8 *file, struct stat *statb)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
||||
char full_path_name[MAX_PATH];
|
||||
char *basename;
|
||||
DWORD rc;
|
||||
|
||||
if (!GetFileAttributesEx ((LPCSTR) file, GetFileExInfoStandard, &wfad))
|
||||
return -1;
|
||||
|
||||
statb->st_dev = 0;
|
||||
|
||||
/* Calculate a pseudo inode number as a hash of the full path name.
|
||||
* Call GetLongPathName() to get the spelling of the path name as it
|
||||
* is on disk.
|
||||
*/
|
||||
rc = GetFullPathName ((LPCSTR) file, sizeof (full_path_name), full_path_name, &basename);
|
||||
if (rc == 0 || rc > sizeof (full_path_name))
|
||||
return -1;
|
||||
|
||||
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
|
||||
statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name);
|
||||
|
||||
statb->st_mode = _S_IREAD | _S_IWRITE;
|
||||
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
|
||||
|
||||
if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
statb->st_mode |= _S_IFDIR;
|
||||
else
|
||||
statb->st_mode |= _S_IFREG;
|
||||
|
||||
statb->st_nlink = 1;
|
||||
statb->st_uid = statb->st_gid = 0;
|
||||
statb->st_rdev = 0;
|
||||
|
||||
if (wfad.nFileSizeHigh > 0)
|
||||
return -1;
|
||||
statb->st_size = wfad.nFileSizeLow;
|
||||
|
||||
statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
|
||||
statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
|
||||
statb->st_ctime = statb->st_mtime;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
FcStat (const FcChar8 *file, struct stat *statb)
|
||||
{
|
||||
return stat ((char *) file, statb);
|
||||
}
|
||||
|
||||
/* Adler-32 checksum implementation */
|
||||
struct Adler32 {
|
||||
int a;
|
||||
int b;
|
||||
};
|
||||
|
||||
static void
|
||||
Adler32Init (struct Adler32 *ctx)
|
||||
{
|
||||
ctx->a = 1;
|
||||
ctx->b = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
Adler32Update (struct Adler32 *ctx, const char *data, int data_len)
|
||||
{
|
||||
while (data_len--)
|
||||
{
|
||||
ctx->a = (ctx->a + *data++) % 65521;
|
||||
ctx->b = (ctx->b + ctx->a) % 65521;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
Adler32Finish (struct Adler32 *ctx)
|
||||
{
|
||||
return ctx->a + (ctx->b << 16);
|
||||
}
|
||||
|
||||
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
/* dirent.d_type can be relied upon on FAT filesystem */
|
||||
static FcBool
|
||||
FcDirChecksumScandirFilter(const struct dirent *entry)
|
||||
{
|
||||
return entry->d_type != DT_DIR;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SCANDIR
|
||||
static int
|
||||
FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs)
|
||||
{
|
||||
return strcmp((*lhs)->d_name, (*rhs)->d_name);
|
||||
}
|
||||
#elif HAVE_SCANDIR_VOID_P
|
||||
static int
|
||||
FcDirChecksumScandirSorter(const void *a, const void *b)
|
||||
{
|
||||
const struct dirent *lhs = a, *rhs = b;
|
||||
|
||||
return strcmp(lhs->d_name, rhs->d_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
FcDirChecksum (const FcChar8 *dir, time_t *checksum)
|
||||
{
|
||||
struct Adler32 ctx;
|
||||
struct dirent **files;
|
||||
int n;
|
||||
int ret = 0;
|
||||
size_t len = strlen ((const char *)dir);
|
||||
|
||||
Adler32Init (&ctx);
|
||||
|
||||
n = scandir ((const char *)dir, &files,
|
||||
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
&FcDirChecksumScandirFilter,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
&FcDirChecksumScandirSorter);
|
||||
if (n == -1)
|
||||
return -1;
|
||||
|
||||
while (n--)
|
||||
{
|
||||
size_t dlen = strlen (files[n]->d_name);
|
||||
int dtype;
|
||||
|
||||
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
dtype = files[n]->d_type;
|
||||
if (dtype == DT_UNKNOWN)
|
||||
{
|
||||
#endif
|
||||
struct stat statb;
|
||||
char f[PATH_MAX + 1];
|
||||
|
||||
memcpy (f, dir, len);
|
||||
f[len] = FC_DIR_SEPARATOR;
|
||||
memcpy (&f[len + 1], files[n]->d_name, dlen);
|
||||
f[len + 1 + dlen] = 0;
|
||||
if (lstat (f, &statb) < 0)
|
||||
{
|
||||
ret = -1;
|
||||
goto bail;
|
||||
}
|
||||
if (S_ISDIR (statb.st_mode))
|
||||
goto bail;
|
||||
|
||||
dtype = statb.st_mode;
|
||||
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
||||
}
|
||||
#endif
|
||||
Adler32Update (&ctx, files[n]->d_name, dlen + 1);
|
||||
Adler32Update (&ctx, (char *)&dtype, sizeof (int));
|
||||
|
||||
bail:
|
||||
free (files[n]);
|
||||
}
|
||||
free (files);
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
|
||||
*checksum = Adler32Finish (&ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
int
|
||||
FcStatChecksum (const FcChar8 *file, struct stat *statb)
|
||||
{
|
||||
if (FcStat (file, statb) == -1)
|
||||
return -1;
|
||||
|
||||
#ifndef _WIN32
|
||||
/* We have a workaround of the broken stat() in FcStat() for Win32.
|
||||
* No need to do something further more.
|
||||
*/
|
||||
if (FcIsFsMtimeBroken (file))
|
||||
{
|
||||
if (FcDirChecksum (file, &statb->st_mtime) == -1)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
FcFStatFs (int fd, FcStatFS *statb)
|
||||
{
|
||||
const char *p = NULL;
|
||||
int ret = -1;
|
||||
FcBool flag = FcFalse;
|
||||
|
||||
#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
|
||||
struct statvfs buf;
|
||||
|
||||
memset (statb, 0, sizeof (FcStatFS));
|
||||
|
||||
if ((ret = fstatvfs (fd, &buf)) == 0)
|
||||
{
|
||||
# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
|
||||
p = buf.f_basetype;
|
||||
# elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
|
||||
p = buf.f_fstypename;
|
||||
# endif
|
||||
}
|
||||
#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
|
||||
struct statfs buf;
|
||||
|
||||
memset (statb, 0, sizeof (FcStatFS));
|
||||
|
||||
if ((ret = fstatfs (fd, &buf)) == 0)
|
||||
{
|
||||
# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
|
||||
statb->is_remote_fs = !(buf.f_flags & MNT_LOCAL);
|
||||
flag = FcTrue;
|
||||
# endif
|
||||
# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
|
||||
p = buf.f_fstypename;
|
||||
# elif defined(__linux__)
|
||||
switch (buf.f_type)
|
||||
{
|
||||
case 0x6969: /* nfs */
|
||||
statb->is_remote_fs = FcTrue;
|
||||
break;
|
||||
case 0x4d44: /* fat */
|
||||
statb->is_mtime_broken = FcTrue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
# else
|
||||
# error "BUG: No way to figure out with fstatfs()"
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
if (p)
|
||||
{
|
||||
if (!flag && strcmp (p, "nfs") == 0)
|
||||
statb->is_remote_fs = FcTrue;
|
||||
if (strcmp (p, "msdosfs") == 0 ||
|
||||
strcmp (p, "pcfs") == 0)
|
||||
statb->is_mtime_broken = FcTrue;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcIsFsMmapSafe (int fd)
|
||||
{
|
||||
FcStatFS statb;
|
||||
|
||||
if (FcFStatFs (fd, &statb) < 0)
|
||||
return FcTrue;
|
||||
|
||||
return !statb.is_remote_fs;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcIsFsMtimeBroken (const FcChar8 *dir)
|
||||
{
|
||||
int fd = FcOpen ((const char *) dir, O_RDONLY);
|
||||
|
||||
if (fd != -1)
|
||||
{
|
||||
FcStatFS statb;
|
||||
int ret = FcFStatFs (fd, &statb);
|
||||
|
||||
close (fd);
|
||||
if (ret < 0)
|
||||
return FcFalse;
|
||||
|
||||
return statb.is_mtime_broken;
|
||||
}
|
||||
|
||||
return FcFalse;
|
||||
}
|
||||
9
project/jni/fontconfig/src/fcstdint.h
Normal file
9
project/jni/fontconfig/src/fcstdint.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _FONTCONFIG_SRC_FCSTDINT_H
|
||||
#define _FONTCONFIG_SRC_FCSTDINT_H 1
|
||||
#ifndef _GENERATED_STDINT_H
|
||||
#define _GENERATED_STDINT_H "fontconfig 2.11.0"
|
||||
/* generated using gnu compiler gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 */
|
||||
#define _STDINT_HAVE_STDINT_H 1
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif
|
||||
1404
project/jni/fontconfig/src/fcstr.c
Normal file
1404
project/jni/fontconfig/src/fcstr.c
Normal file
File diff suppressed because it is too large
Load Diff
44
project/jni/fontconfig/src/fcwindows.h
Normal file
44
project/jni/fontconfig/src/fcwindows.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* fontconfig/src/fcwindows.h
|
||||
*
|
||||
* Copyright © 2013 Google, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of the author(s) not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. The authors make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Google Author(s): Behdad Esfahbod
|
||||
*/
|
||||
|
||||
#ifndef _FCWINDOWS_H_
|
||||
#define _FCWINDOWS_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_EXTRA_LEAN
|
||||
# define STRICT
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#endif /* _FCWINDOWS_H_ */
|
||||
3212
project/jni/fontconfig/src/fcxml.c
Normal file
3212
project/jni/fontconfig/src/fcxml.c
Normal file
File diff suppressed because it is too large
Load Diff
261
project/jni/fontconfig/src/ftglue.c
Normal file
261
project/jni/fontconfig/src/ftglue.c
Normal file
@@ -0,0 +1,261 @@
|
||||
/* ftglue.c: Glue code for compiling the OpenType code from
|
||||
* FreeType 1 using only the public API of FreeType 2
|
||||
*
|
||||
* By David Turner, The FreeType Project (www.freetype.org)
|
||||
*
|
||||
* This code is explicitely put in the public domain
|
||||
*
|
||||
* See ftglue.h for more information.
|
||||
*/
|
||||
|
||||
#include "ftglue.h"
|
||||
|
||||
#if 0
|
||||
#include <stdio.h>
|
||||
#define LOG(x) ftglue_log x
|
||||
|
||||
static void
|
||||
ftglue_log( const char* format, ... )
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start( ap, format );
|
||||
vfprintf( stderr, format, ap );
|
||||
va_end( ap );
|
||||
}
|
||||
|
||||
#else
|
||||
#define LOG(x) do {} while (0)
|
||||
#endif
|
||||
|
||||
/* only used internally */
|
||||
static FT_Pointer
|
||||
ftglue_qalloc( FT_Memory memory,
|
||||
FT_ULong size,
|
||||
FT_Error *perror )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
FT_Pointer block = NULL;
|
||||
|
||||
if ( size > 0 )
|
||||
{
|
||||
block = memory->alloc( memory, size );
|
||||
if ( !block )
|
||||
error = FT_Err_Out_Of_Memory;
|
||||
}
|
||||
|
||||
*perror = error;
|
||||
return block;
|
||||
}
|
||||
|
||||
#undef QALLOC /* just in case */
|
||||
#define QALLOC(ptr,size) ( (ptr) = ftglue_qalloc( memory, (size), &error ), error != 0 )
|
||||
#define FREE(_ptr) \
|
||||
do { \
|
||||
if ( (_ptr) ) \
|
||||
{ \
|
||||
ftglue_free( memory, _ptr ); \
|
||||
_ptr = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
static void
|
||||
ftglue_free( FT_Memory memory,
|
||||
FT_Pointer block )
|
||||
{
|
||||
if ( block )
|
||||
memory->free( memory, block );
|
||||
}
|
||||
|
||||
FTGLUE_APIDEF( FT_Long )
|
||||
ftglue_stream_pos( FT_Stream stream )
|
||||
{
|
||||
LOG(( "ftglue:stream:pos() -> %ld\n", stream->pos ));
|
||||
return stream->pos;
|
||||
}
|
||||
|
||||
|
||||
FTGLUE_APIDEF( FT_Error )
|
||||
ftglue_stream_seek( FT_Stream stream,
|
||||
FT_Long pos )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
|
||||
if ( stream->read )
|
||||
{
|
||||
if ( stream->read( stream, pos, 0, 0 ) )
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
else if ( pos < 0 || (FT_ULong) pos > stream->size )
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
|
||||
if ( !error )
|
||||
stream->pos = pos;
|
||||
LOG(( "ftglue:stream:seek(%ld) -> %d\n", pos, error ));
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FTGLUE_APIDEF( FT_Error )
|
||||
ftglue_stream_frame_enter( FT_Stream stream,
|
||||
FT_ULong count )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_ULong read_bytes;
|
||||
|
||||
if ( stream->read )
|
||||
{
|
||||
/* allocate the frame in memory */
|
||||
FT_Memory memory = stream->memory;
|
||||
|
||||
|
||||
if ( QALLOC( stream->base, count ) )
|
||||
goto Exit;
|
||||
|
||||
/* read it */
|
||||
read_bytes = stream->read( stream, stream->pos,
|
||||
stream->base, count );
|
||||
if ( read_bytes < count )
|
||||
{
|
||||
FREE( stream->base );
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
stream->cursor = stream->base;
|
||||
stream->limit = stream->cursor + count;
|
||||
stream->pos += read_bytes;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* check current and new position */
|
||||
if ( stream->pos >= stream->size ||
|
||||
stream->pos + count > stream->size )
|
||||
{
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* set cursor */
|
||||
stream->cursor = stream->base + stream->pos;
|
||||
stream->limit = stream->cursor + count;
|
||||
stream->pos += count;
|
||||
}
|
||||
|
||||
Exit:
|
||||
LOG(( "ftglue:stream:frame_enter(%ld) -> %d\n", count, error ));
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
FTGLUE_APIDEF( void )
|
||||
ftglue_stream_frame_exit( FT_Stream stream )
|
||||
{
|
||||
if ( stream->read )
|
||||
{
|
||||
FT_Memory memory = stream->memory;
|
||||
|
||||
FREE( stream->base );
|
||||
}
|
||||
stream->cursor = 0;
|
||||
stream->limit = 0;
|
||||
|
||||
LOG(( "ftglue:stream:frame_exit()\n" ));
|
||||
}
|
||||
|
||||
|
||||
FTGLUE_APIDEF( FT_Error )
|
||||
ftglue_face_goto_table( FT_Face face,
|
||||
FT_ULong the_tag,
|
||||
FT_Stream stream )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
LOG(( "ftglue_face_goto_table( %p, %c%c%c%c, %p )\n",
|
||||
face,
|
||||
(int)((the_tag >> 24) & 0xFF),
|
||||
(int)((the_tag >> 16) & 0xFF),
|
||||
(int)((the_tag >> 8) & 0xFF),
|
||||
(int)(the_tag & 0xFF),
|
||||
stream ));
|
||||
|
||||
if ( !FT_IS_SFNT(face) )
|
||||
{
|
||||
LOG(( "not a SFNT face !!\n" ));
|
||||
error = FT_Err_Invalid_Face_Handle;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* parse the directory table directly, without using
|
||||
* FreeType's built-in data structures
|
||||
*/
|
||||
FT_ULong offset = 0, sig;
|
||||
FT_UInt count, nn;
|
||||
|
||||
if ( FILE_Seek( 0 ) || ACCESS_Frame( 4 ) )
|
||||
goto Exit;
|
||||
|
||||
sig = GET_Tag4();
|
||||
|
||||
FORGET_Frame();
|
||||
|
||||
if ( sig == FT_MAKE_TAG( 't', 't', 'c', 'f' ) )
|
||||
{
|
||||
/* deal with TrueType collections */
|
||||
|
||||
LOG(( ">> This is a TrueType Collection\n" ));
|
||||
|
||||
if ( FILE_Seek( 12 + face->face_index*4 ) ||
|
||||
ACCESS_Frame( 4 ) )
|
||||
goto Exit;
|
||||
|
||||
offset = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
}
|
||||
|
||||
LOG(( "TrueType offset = %ld\n", offset ));
|
||||
|
||||
if ( FILE_Seek( offset+4 ) ||
|
||||
ACCESS_Frame( 2 ) )
|
||||
goto Exit;
|
||||
|
||||
count = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
|
||||
if ( FILE_Seek( offset+12 ) ||
|
||||
ACCESS_Frame( count*16 ) )
|
||||
goto Exit;
|
||||
|
||||
for ( nn = 0; nn < count; nn++ )
|
||||
{
|
||||
FT_ULong tag = GET_ULong();
|
||||
FT_ULong checksum = GET_ULong();
|
||||
FT_ULong start = GET_ULong();
|
||||
FT_ULong size = GET_ULong();
|
||||
|
||||
FT_UNUSED(checksum);
|
||||
FT_UNUSED(size);
|
||||
|
||||
if ( tag == the_tag )
|
||||
{
|
||||
LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size ));
|
||||
error = ftglue_stream_seek( stream, start );
|
||||
goto FoundIt;
|
||||
}
|
||||
}
|
||||
error = FT_Err_Table_Missing;
|
||||
|
||||
FoundIt:
|
||||
FORGET_Frame();
|
||||
}
|
||||
|
||||
Exit:
|
||||
LOG(( "TrueType error=%d\n", error ));
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#undef QALLOC
|
||||
#include "fcaliastail.h"
|
||||
#undef __ftglue__
|
||||
111
project/jni/fontconfig/src/ftglue.h
Normal file
111
project/jni/fontconfig/src/ftglue.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/* ftglue.c: Glue code for compiling the OpenType code from
|
||||
* FreeType 1 using only the public API of FreeType 2
|
||||
*
|
||||
* By David Turner, The FreeType Project (www.freetype.org)
|
||||
*
|
||||
* This code is explicitely put in the public domain
|
||||
*
|
||||
* ==========================================================================
|
||||
*
|
||||
* the OpenType parser codes was originally written as an extension to
|
||||
* FreeType 1.x. As such, its source code was embedded within the library,
|
||||
* and used many internal FreeType functions to deal with memory and
|
||||
* stream i/o.
|
||||
*
|
||||
* When it was 'salvaged' for Pango and Qt, the code was "ported" to FreeType 2,
|
||||
* which basically means that some macro tricks were performed in order to
|
||||
* directly access FT2 _internal_ functions.
|
||||
*
|
||||
* these functions were never part of FT2 public API, and _did_ change between
|
||||
* various releases. This created chaos for many users: when they upgraded the
|
||||
* FreeType library on their system, they couldn't run Gnome anymore since
|
||||
* Pango refused to link.
|
||||
*
|
||||
* Very fortunately, it's possible to completely avoid this problem because
|
||||
* the FT_StreamRec and FT_MemoryRec structure types, which describe how
|
||||
* memory and stream implementations interface with the rest of the font
|
||||
* library, have always been part of the public API, and never changed.
|
||||
*
|
||||
* What we do thus is re-implement, within the OpenType parser, the few
|
||||
* functions that depend on them. This only adds one or two kilobytes of
|
||||
* code, and ensures that the parser can work with _any_ version
|
||||
* of FreeType installed on your system. How sweet... !
|
||||
*
|
||||
* Note that we assume that Pango doesn't use any other internal functions
|
||||
* from FreeType. It used to in old versions, but this should no longer
|
||||
* be the case. (crossing my fingers).
|
||||
*
|
||||
* - David Turner
|
||||
* - The FreeType Project (www.freetype.org)
|
||||
*
|
||||
* PS: This "glue" code is explicitely put in the public domain
|
||||
*/
|
||||
#ifndef __OPENTYPE_FTGLUE_H__
|
||||
#define __OPENTYPE_FTGLUE_H__
|
||||
|
||||
#include "fcint.h"
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
#define SET_ERR(c) ( (error = (c)) != 0 )
|
||||
|
||||
#ifndef FTGLUE_API
|
||||
#define FTGLUE_API(x) extern FcPrivate x
|
||||
#endif
|
||||
|
||||
#ifndef FTGLUE_APIDEF
|
||||
#define FTGLUE_APIDEF(x) x
|
||||
#endif
|
||||
|
||||
/* stream macros used by the OpenType parser */
|
||||
#define FILE_Pos() ftglue_stream_pos( stream )
|
||||
#define FILE_Seek(pos) SET_ERR( ftglue_stream_seek( stream, pos ) )
|
||||
#define ACCESS_Frame(size) SET_ERR( ftglue_stream_frame_enter( stream, size ) )
|
||||
#define FORGET_Frame() ftglue_stream_frame_exit( stream )
|
||||
|
||||
#define GET_Byte() (*stream->cursor++)
|
||||
#define GET_Short() (stream->cursor += 2, (FT_Short)( \
|
||||
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
|
||||
*(((FT_Byte*)stream->cursor)-1) \
|
||||
))
|
||||
#define GET_Long() (stream->cursor += 4, (FT_Long)( \
|
||||
(*(((FT_Byte*)stream->cursor)-4) << 24) | \
|
||||
(*(((FT_Byte*)stream->cursor)-3) << 16) | \
|
||||
(*(((FT_Byte*)stream->cursor)-2) << 8) | \
|
||||
*(((FT_Byte*)stream->cursor)-1) \
|
||||
))
|
||||
|
||||
#define GET_Char() ((FT_Char)GET_Byte())
|
||||
#define GET_UShort() ((FT_UShort)GET_Short())
|
||||
#define GET_ULong() ((FT_ULong)GET_Long())
|
||||
#define GET_Tag4() GET_ULong()
|
||||
|
||||
#define FT_SET_ERROR( expression ) \
|
||||
( ( error = (expression) ) != 0 )
|
||||
|
||||
FTGLUE_API( FT_Long )
|
||||
ftglue_stream_pos( FT_Stream stream );
|
||||
|
||||
FTGLUE_API( FT_Error )
|
||||
ftglue_stream_seek( FT_Stream stream,
|
||||
FT_Long pos );
|
||||
|
||||
FTGLUE_API( FT_Error )
|
||||
ftglue_stream_frame_enter( FT_Stream stream,
|
||||
FT_ULong size );
|
||||
|
||||
FTGLUE_API( void )
|
||||
ftglue_stream_frame_exit( FT_Stream stream );
|
||||
|
||||
FTGLUE_API( FT_Error )
|
||||
ftglue_face_goto_table( FT_Face face,
|
||||
FT_ULong tag,
|
||||
FT_Stream stream );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __OPENTYPE_FTGLUE_H__ */
|
||||
Reference in New Issue
Block a user