laag-fontconfig 2.13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +57 -0
- data/LICENSE.txt +28 -0
- data/README.org +34 -0
- data/ext/laag/fontconfig/extconf.rb +13 -0
- data/laag-fontconfig.gemspec +20 -0
- data/lib/laag/fontconfig.rb +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/AUTHORS +3 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/COPYING +28 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/INSTALL +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/Makefile.am +158 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/NEWS +0 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/README +2016 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/Tools.mk +64 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/autogen.sh +126 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-autohint.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-hinting-full.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-hinting-medium.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-hinting-none.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-hinting-slight.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-no-sub-pixel.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-scale-bitmap-fonts.conf +87 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-sub-pixel-bgr.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-sub-pixel-rgb.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-sub-pixel-vbgr.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-sub-pixel-vrgb.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/10-unhinted.conf +19 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/11-lcdfilter-default.conf +21 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/11-lcdfilter-legacy.conf +21 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/11-lcdfilter-light.conf +21 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/20-unhint-small-vera.conf +53 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/25-unhint-nonlatin.conf +132 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/30-metric-aliases.conf +634 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/40-nonlatin.conf +236 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/45-generic.conf +136 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/45-latin.conf +278 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/49-sansserif.conf +26 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/50-user.conf +20 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/51-local.conf +11 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/60-generic.conf +67 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/60-latin.conf +79 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/65-fonts-persian.conf +423 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/65-khmer.conf +20 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/65-nonlatin.conf +200 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/69-unifont.conf +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/70-no-bitmaps.conf +17 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/70-yes-bitmaps.conf +17 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/80-delicious.conf +23 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/90-synthetic.conf +68 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/Makefile.am +110 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/conf.d/README.in +23 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/config-fixups.h +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/configure.ac +793 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/Makefile.am +224 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/check-missing-doc +24 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/confdir.sgml.in +26 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/edit-sgml.c +546 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcatomic.fncs +95 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcblanks.fncs +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fccache.fncs +104 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fccharset.fncs +242 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcconfig.fncs +447 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcconstant.fncs +58 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcdircache.fncs +99 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcfile.fncs +88 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcfontset.fncs +140 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcformat.fncs +309 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcfreetype.fncs +135 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcinit.fncs +92 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fclangset.fncs +201 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcmatrix.fncs +125 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcobjectset.fncs +73 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcobjecttype.fncs +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcpattern.fncs +433 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcrange.fncs +75 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcstring.fncs +244 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcstrset.fncs +124 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcvalue.fncs +61 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fcweight.fncs +69 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fontconfig-devel.sgml +613 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/fontconfig-user.sgml +812 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/func.sgml +91 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/doc/version.sgml.in +24 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cache/Makefile.am +69 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cache/fc-cache.c +423 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cache/fc-cache.sgml +249 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-case/CaseFolding.txt +1495 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-case/Makefile.am +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-case/fc-case.c +363 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-case/fccase.tmpl.h +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cat/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cat/fc-cat.c +400 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-cat/fc-cat.sgml +169 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-conflist/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-conflist/fc-conflist.c +142 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-conflist/fc-conflist.sgml +135 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/Makefile.am +288 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/README +28 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/aa.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ab.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/af.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ak.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/am.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/an.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ar.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/as.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ast.orth +47 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/av.orth +97 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ay.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/az_az.orth +53 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/az_ir.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ba.orth +56 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/be.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ber_dz.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ber_ma.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bg.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bh.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bho.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bi.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bin.orth +55 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bm.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bn.orth +44 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bo.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/br.orth +47 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/brx.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bs.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/bua.orth +102 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/byn.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ca.orth +58 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ce.orth +97 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ch.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/chm.orth +109 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/chr.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/co.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/crh.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/cs.orth +67 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/csb.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/cu.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/cv.orth +109 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/cy.orth +63 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/da.orth +89 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/de.orth +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/doi.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/dv.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/dz.orth +28 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ee.orth +77 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/el.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/en.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/eo.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/es.orth +50 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/et.orth +47 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/eu.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fa.orth +73 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fat.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fc-lang.c +595 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fc-lang.man +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fclang.tmpl.h +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ff.orth +38 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fi.orth +51 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fil.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fj.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fo.orth +59 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fr.orth +58 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fur.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/fy.orth +61 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ga.orth +84 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gd.orth +51 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gez.orth +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gl.orth +50 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gn.orth +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gu.orth +41 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/gv.orth +31 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ha.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/haw.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/he.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hi.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hne.orth +28 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ho.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hr.orth +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hsb.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ht.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hu.orth +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hy.orth +26 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/hz.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ia.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/id.orth +31 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ie.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ig.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ii.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ik.orth +100 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/io.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/is.orth +64 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/iso-3166.txt +242 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/iso639-1 +139 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/iso639-2 +473 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/it.orth +51 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/iu.orth +77 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ja.orth +2345 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/jv.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ka.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kaa.orth +110 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kab.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ki.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kj.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kk.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kl.orth +63 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/km.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kn.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ko.orth +2537 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kok.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kr.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ks.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ku_am.orth +91 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ku_iq.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ku_ir.orth +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ku_tr.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kum.orth +96 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kv.orth +101 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kw.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/kwm.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ky.orth +102 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/la.orth +31 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lah.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lb.orth +62 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lez.orth +97 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lg.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/li.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ln.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lo.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lt.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/lv.orth +44 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mai.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mg.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mh.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mi.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mk.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ml.orth +38 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mn_cn.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mn_mn.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mni.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mo.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mr.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ms.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/mt.orth +67 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/my.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/na.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nb.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nds.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ne.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ng.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nl.orth +63 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nn.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/no.orth +68 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nqo.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nr.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nso.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/nv.orth +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ny.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/oc.orth +53 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/om.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/or.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/os.orth +96 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ota.orth +41 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pa.orth +53 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pa_pk.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pap_an.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pap_aw.orth +31 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pes.orth +26 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pl.orth +41 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/prs.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ps_af.orth +52 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ps_pk.orth +52 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/pt.orth +64 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/qu.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/quz.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/rm.orth +45 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/rn.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ro.orth +38 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ru.orth +38 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/rw.orth +31 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sa.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sah.orth +108 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sat.orth +44 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sc.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sco.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sd.orth +58 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/se.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sel.orth +96 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sg.orth +47 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sh.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/shs.orth +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/si.orth +75 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sid.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sk.orth +63 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sl.orth +88 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sm.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sma.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/smj.orth +37 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/smn.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sms.orth +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sn.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/so.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sq.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sr.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ss.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/st.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/su.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sv.orth +100 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/sw.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/syr.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ta.orth +46 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/te.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tg.orth +108 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/th.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ti_er.orth +56 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ti_et.orth +33 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tig.orth +52 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tk.orth +44 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tl.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tn.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/to.orth +30 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tr.orth +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ts.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tt.orth +108 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tw.orth +50 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ty.orth +41 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/tyv.orth +102 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ug.orth +50 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/uk.orth +43 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/und_zmth.orth +144 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/und_zsye.orth +151 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ur.orth +68 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/uz.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/ve.orth +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/vi.orth +58 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/vo.orth +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/vot.orth +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/wa.orth +47 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/wal.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/wen.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/wo.orth +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/xh.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/yap.orth +35 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/yi.orth +25 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/yo.orth +86 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/za.orth +39 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zh_cn.orth +6792 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zh_hk.orth +1119 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zh_mo.orth +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zh_sg.orth +27 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zh_tw.orth +13105 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-lang/zu.orth +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-list/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-list/fc-list.c +220 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-list/fc-list.sgml +227 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-match/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-match/fc-match.c +268 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-match/fc-match.sgml +217 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-pattern/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-pattern/fc-pattern.c +203 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-pattern/fc-pattern.sgml +204 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-query/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-query/fc-query.c +194 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-query/fc-query.sgml +204 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-scan/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-scan/fc-scan.c +197 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-scan/fc-scan.sgml +177 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-validate/Makefile.am +60 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-validate/fc-validate.c +250 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fc-validate/fc-validate.sgml +182 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig-zip.in +29 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig.pc.in +18 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig.spec.in +138 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig/Makefile.am +10 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig/fcfreetype.h +59 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig/fcprivate.h +134 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fontconfig/fontconfig.h +1107 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fonts.conf.in +94 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/fonts.dtd +233 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/git.mk +254 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/its/Makefile.am +11 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/its/fontconfig.its +4 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/its/fontconfig.loc +6 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/local.conf +42 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/.gitkeep +0 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/ac_check_symbol.m4 +48 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/ax_cc_for_build.m4 +77 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/ax_create_stdint_h.m4 +695 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/ax_pthread.m4 +337 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/m4/pkg.m4 +214 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/new-version.sh +139 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po-conf/ChangeLog +12 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po-conf/LINGUAS +2 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po-conf/Makevars +80 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po-conf/POTFILES.in +34 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po-conf/zh_CN.po +140 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po/ChangeLog +12 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po/LINGUAS +2 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po/Makevars +78 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po/POTFILES.in +11 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/po/zh_CN.po +608 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/Makefile.am +222 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcarch.c +59 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcarch.h +76 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcatomic.c +229 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcatomic.h +145 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fccache.c +1880 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fccfg.c +2668 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fccharset.c +1400 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fccompat.c +280 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcdbg.c +587 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcdefault.c +343 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcdeprecate.h +36 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcdir.c +435 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcformat.c +1220 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcfreetype.c +2626 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcfs.c +149 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcftint.h +54 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fchash.c +216 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcinit.c +258 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcint.h +1344 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fclang.c +1110 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fclist.c +645 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcmatch.c +1240 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcmatrix.c +116 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcmutex.h +127 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcname.c +634 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcobjs.c +168 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcobjs.h +75 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcobjshash.gperf.h +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcpat.c +1420 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcptrlist.c +198 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcrange.c +160 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcserialize.c +155 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcstat.c +442 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcstr.c +1371 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcweight.c +103 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcwindows.h +49 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/fcxml.c +3508 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/ftglue.c +261 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/ftglue.h +111 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/src/makealias +38 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/4x6.pcf +0 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/8x16.pcf +0 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/Makefile.am +64 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/fonts.conf.in +4 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/out.expected-long-family-names +8 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/out.expected-no-long-family-names +8 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/run-test.sh +205 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/test-bz131804.c +135 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/test-bz89617.c +40 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/test-bz96676.c +32 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/test-migration.c +230 -0
- data/vendor/anongit.freedesktop.org/git/fontconfig/test/test-pthread.c +101 -0
- metadata +518 -0
@@ -0,0 +1,442 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright © 2000 Keith Packard
|
3
|
+
* Copyright © 2005 Patrick Lam
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, distribute, and sell this software and its
|
6
|
+
* documentation for any purpose is hereby granted without fee, provided that
|
7
|
+
* the above copyright notice appear in all copies and that both that
|
8
|
+
* copyright notice and this permission notice appear in supporting
|
9
|
+
* documentation, and that the name of the author(s) not be used in
|
10
|
+
* advertising or publicity pertaining to distribution of the software without
|
11
|
+
* specific, written prior permission. The authors make no
|
12
|
+
* representations about the suitability of this software for any purpose. It
|
13
|
+
* is provided "as is" without express or implied warranty.
|
14
|
+
*
|
15
|
+
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
16
|
+
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
17
|
+
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
18
|
+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
19
|
+
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
20
|
+
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
21
|
+
* PERFORMANCE OF THIS SOFTWARE.
|
22
|
+
*/
|
23
|
+
#include "fcint.h"
|
24
|
+
#include "fcarch.h"
|
25
|
+
#include <dirent.h>
|
26
|
+
#include <limits.h>
|
27
|
+
#include <sys/types.h>
|
28
|
+
#include <sys/stat.h>
|
29
|
+
#include <fcntl.h>
|
30
|
+
#ifdef HAVE_SYS_VFS_H
|
31
|
+
#include <sys/vfs.h>
|
32
|
+
#endif
|
33
|
+
#ifdef HAVE_SYS_STATVFS_H
|
34
|
+
#include <sys/statvfs.h>
|
35
|
+
#endif
|
36
|
+
#ifdef HAVE_SYS_STATFS_H
|
37
|
+
#include <sys/statfs.h>
|
38
|
+
#endif
|
39
|
+
#ifdef HAVE_SYS_PARAM_H
|
40
|
+
#include <sys/param.h>
|
41
|
+
#endif
|
42
|
+
#ifdef HAVE_SYS_MOUNT_H
|
43
|
+
#include <sys/mount.h>
|
44
|
+
#endif
|
45
|
+
#include <errno.h>
|
46
|
+
|
47
|
+
#ifdef _WIN32
|
48
|
+
#ifdef __GNUC__
|
49
|
+
typedef long long INT64;
|
50
|
+
#define EPOCH_OFFSET 11644473600ll
|
51
|
+
#else
|
52
|
+
#define EPOCH_OFFSET 11644473600i64
|
53
|
+
typedef __int64 INT64;
|
54
|
+
#endif
|
55
|
+
|
56
|
+
/* Workaround for problems in the stat() in the Microsoft C library:
|
57
|
+
*
|
58
|
+
* 1) stat() uses FindFirstFile() to get the file
|
59
|
+
* attributes. Unfortunately this API doesn't return correct values
|
60
|
+
* for modification time of a directory until some time after a file
|
61
|
+
* or subdirectory has been added to the directory. (This causes
|
62
|
+
* run-test.sh to fail, for instance.) GetFileAttributesEx() is
|
63
|
+
* better, it returns the updated timestamp right away.
|
64
|
+
*
|
65
|
+
* 2) stat() does some strange things related to backward
|
66
|
+
* compatibility with the local time timestamps on FAT volumes and
|
67
|
+
* daylight saving time. This causes problems after the switches
|
68
|
+
* to/from daylight saving time. See
|
69
|
+
* http://bugzilla.gnome.org/show_bug.cgi?id=154968 , especially
|
70
|
+
* comment #30, and http://www.codeproject.com/datetime/dstbugs.asp .
|
71
|
+
* We don't need any of that, FAT and Win9x are as good as dead. So
|
72
|
+
* just use the UTC timestamps from NTFS, converted to the Unix epoch.
|
73
|
+
*/
|
74
|
+
|
75
|
+
int
|
76
|
+
FcStat (const FcChar8 *file, struct stat *statb)
|
77
|
+
{
|
78
|
+
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
79
|
+
char full_path_name[MAX_PATH];
|
80
|
+
char *basename;
|
81
|
+
DWORD rc;
|
82
|
+
|
83
|
+
if (!GetFileAttributesEx ((LPCSTR) file, GetFileExInfoStandard, &wfad))
|
84
|
+
return -1;
|
85
|
+
|
86
|
+
statb->st_dev = 0;
|
87
|
+
|
88
|
+
/* Calculate a pseudo inode number as a hash of the full path name.
|
89
|
+
* Call GetLongPathName() to get the spelling of the path name as it
|
90
|
+
* is on disk.
|
91
|
+
*/
|
92
|
+
rc = GetFullPathName ((LPCSTR) file, sizeof (full_path_name), full_path_name, &basename);
|
93
|
+
if (rc == 0 || rc > sizeof (full_path_name))
|
94
|
+
return -1;
|
95
|
+
|
96
|
+
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
|
97
|
+
statb->st_ino = FcStringHash ((const FcChar8 *) full_path_name);
|
98
|
+
|
99
|
+
statb->st_mode = _S_IREAD | _S_IWRITE;
|
100
|
+
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
|
101
|
+
|
102
|
+
if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
103
|
+
statb->st_mode |= _S_IFDIR;
|
104
|
+
else
|
105
|
+
statb->st_mode |= _S_IFREG;
|
106
|
+
|
107
|
+
statb->st_nlink = 1;
|
108
|
+
statb->st_uid = statb->st_gid = 0;
|
109
|
+
statb->st_rdev = 0;
|
110
|
+
|
111
|
+
if (wfad.nFileSizeHigh > 0)
|
112
|
+
return -1;
|
113
|
+
statb->st_size = wfad.nFileSizeLow;
|
114
|
+
|
115
|
+
statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
|
116
|
+
statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
|
117
|
+
statb->st_ctime = statb->st_mtime;
|
118
|
+
|
119
|
+
return 0;
|
120
|
+
}
|
121
|
+
|
122
|
+
#else
|
123
|
+
|
124
|
+
int
|
125
|
+
FcStat (const FcChar8 *file, struct stat *statb)
|
126
|
+
{
|
127
|
+
return stat ((char *) file, statb);
|
128
|
+
}
|
129
|
+
|
130
|
+
/* Adler-32 checksum implementation */
|
131
|
+
struct Adler32 {
|
132
|
+
int a;
|
133
|
+
int b;
|
134
|
+
};
|
135
|
+
|
136
|
+
static void
|
137
|
+
Adler32Init (struct Adler32 *ctx)
|
138
|
+
{
|
139
|
+
ctx->a = 1;
|
140
|
+
ctx->b = 0;
|
141
|
+
}
|
142
|
+
|
143
|
+
static void
|
144
|
+
Adler32Update (struct Adler32 *ctx, const char *data, int data_len)
|
145
|
+
{
|
146
|
+
while (data_len--)
|
147
|
+
{
|
148
|
+
ctx->a = (ctx->a + *data++) % 65521;
|
149
|
+
ctx->b = (ctx->b + ctx->a) % 65521;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
static int
|
154
|
+
Adler32Finish (struct Adler32 *ctx)
|
155
|
+
{
|
156
|
+
return ctx->a + (ctx->b << 16);
|
157
|
+
}
|
158
|
+
|
159
|
+
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
160
|
+
/* dirent.d_type can be relied upon on FAT filesystem */
|
161
|
+
static FcBool
|
162
|
+
FcDirChecksumScandirFilter(const struct dirent *entry)
|
163
|
+
{
|
164
|
+
return entry->d_type != DT_DIR;
|
165
|
+
}
|
166
|
+
#endif
|
167
|
+
|
168
|
+
static int
|
169
|
+
FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs)
|
170
|
+
{
|
171
|
+
return strcmp((*lhs)->d_name, (*rhs)->d_name);
|
172
|
+
}
|
173
|
+
|
174
|
+
static void
|
175
|
+
free_dirent (struct dirent **p)
|
176
|
+
{
|
177
|
+
struct dirent **x;
|
178
|
+
|
179
|
+
for (x = p; *x != NULL; x++)
|
180
|
+
free (*x);
|
181
|
+
|
182
|
+
free (p);
|
183
|
+
}
|
184
|
+
|
185
|
+
int
|
186
|
+
FcScandir (const char *dirp,
|
187
|
+
struct dirent ***namelist,
|
188
|
+
int (*filter) (const struct dirent *),
|
189
|
+
int (*compar) (const struct dirent **, const struct dirent **));
|
190
|
+
|
191
|
+
int
|
192
|
+
FcScandir (const char *dirp,
|
193
|
+
struct dirent ***namelist,
|
194
|
+
int (*filter) (const struct dirent *),
|
195
|
+
int (*compar) (const struct dirent **, const struct dirent **))
|
196
|
+
{
|
197
|
+
DIR *d;
|
198
|
+
struct dirent *dent, *p, **dlist, **dlp;
|
199
|
+
size_t lsize = 128, n = 0;
|
200
|
+
|
201
|
+
d = opendir (dirp);
|
202
|
+
if (!d)
|
203
|
+
return -1;
|
204
|
+
|
205
|
+
dlist = (struct dirent **) malloc (sizeof (struct dirent *) * lsize);
|
206
|
+
if (!dlist)
|
207
|
+
{
|
208
|
+
closedir (d);
|
209
|
+
errno = ENOMEM;
|
210
|
+
|
211
|
+
return -1;
|
212
|
+
}
|
213
|
+
*dlist = NULL;
|
214
|
+
while ((dent = readdir (d)))
|
215
|
+
{
|
216
|
+
if (!filter || (filter) (dent))
|
217
|
+
{
|
218
|
+
size_t dentlen = FcPtrToOffset (dent, dent->d_name) + strlen (dent->d_name) + 1;
|
219
|
+
dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1));
|
220
|
+
p = (struct dirent *) malloc (dentlen);
|
221
|
+
memcpy (p, dent, dentlen);
|
222
|
+
if ((n + 1) >= lsize)
|
223
|
+
{
|
224
|
+
lsize += 128;
|
225
|
+
dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize);
|
226
|
+
if (!dlp)
|
227
|
+
{
|
228
|
+
free_dirent (dlist);
|
229
|
+
closedir (d);
|
230
|
+
errno = ENOMEM;
|
231
|
+
|
232
|
+
return -1;
|
233
|
+
}
|
234
|
+
dlist = dlp;
|
235
|
+
}
|
236
|
+
dlist[n++] = p;
|
237
|
+
dlist[n] = NULL;
|
238
|
+
}
|
239
|
+
}
|
240
|
+
closedir (d);
|
241
|
+
|
242
|
+
qsort (dlist, n, sizeof (struct dirent *), (int (*) (const void *, const void *))compar);
|
243
|
+
|
244
|
+
*namelist = dlist;
|
245
|
+
|
246
|
+
return n;
|
247
|
+
}
|
248
|
+
|
249
|
+
static int
|
250
|
+
FcDirChecksum (const FcChar8 *dir, time_t *checksum)
|
251
|
+
{
|
252
|
+
struct Adler32 ctx;
|
253
|
+
struct dirent **files;
|
254
|
+
int n;
|
255
|
+
int ret = 0;
|
256
|
+
size_t len = strlen ((const char *)dir);
|
257
|
+
|
258
|
+
Adler32Init (&ctx);
|
259
|
+
|
260
|
+
n = FcScandir ((const char *)dir, &files,
|
261
|
+
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
262
|
+
&FcDirChecksumScandirFilter,
|
263
|
+
#else
|
264
|
+
NULL,
|
265
|
+
#endif
|
266
|
+
&FcDirChecksumScandirSorter);
|
267
|
+
if (n == -1)
|
268
|
+
return -1;
|
269
|
+
|
270
|
+
while (n--)
|
271
|
+
{
|
272
|
+
size_t dlen = strlen (files[n]->d_name);
|
273
|
+
int dtype;
|
274
|
+
|
275
|
+
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
276
|
+
dtype = files[n]->d_type;
|
277
|
+
if (dtype == DT_UNKNOWN)
|
278
|
+
{
|
279
|
+
#endif
|
280
|
+
struct stat statb;
|
281
|
+
char *f = malloc (len + 1 + dlen + 1);
|
282
|
+
|
283
|
+
if (!f)
|
284
|
+
{
|
285
|
+
ret = -1;
|
286
|
+
goto bail;
|
287
|
+
}
|
288
|
+
memcpy (f, dir, len);
|
289
|
+
f[len] = FC_DIR_SEPARATOR;
|
290
|
+
memcpy (&f[len + 1], files[n]->d_name, dlen);
|
291
|
+
f[len + 1 + dlen] = 0;
|
292
|
+
if (lstat (f, &statb) < 0)
|
293
|
+
{
|
294
|
+
ret = -1;
|
295
|
+
free (f);
|
296
|
+
goto bail;
|
297
|
+
}
|
298
|
+
if (S_ISDIR (statb.st_mode))
|
299
|
+
{
|
300
|
+
free (f);
|
301
|
+
goto bail;
|
302
|
+
}
|
303
|
+
|
304
|
+
free (f);
|
305
|
+
dtype = statb.st_mode;
|
306
|
+
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
|
307
|
+
}
|
308
|
+
#endif
|
309
|
+
Adler32Update (&ctx, files[n]->d_name, dlen + 1);
|
310
|
+
Adler32Update (&ctx, (char *)&dtype, sizeof (int));
|
311
|
+
|
312
|
+
bail:
|
313
|
+
free (files[n]);
|
314
|
+
}
|
315
|
+
free (files);
|
316
|
+
if (ret == -1)
|
317
|
+
return -1;
|
318
|
+
|
319
|
+
*checksum = Adler32Finish (&ctx);
|
320
|
+
|
321
|
+
return 0;
|
322
|
+
}
|
323
|
+
#endif /* _WIN32 */
|
324
|
+
|
325
|
+
int
|
326
|
+
FcStatChecksum (const FcChar8 *file, struct stat *statb)
|
327
|
+
{
|
328
|
+
if (FcStat (file, statb) == -1)
|
329
|
+
return -1;
|
330
|
+
|
331
|
+
#ifndef _WIN32
|
332
|
+
/* We have a workaround of the broken stat() in FcStat() for Win32.
|
333
|
+
* No need to do something further more.
|
334
|
+
*/
|
335
|
+
if (FcIsFsMtimeBroken (file))
|
336
|
+
{
|
337
|
+
if (FcDirChecksum (file, &statb->st_mtime) == -1)
|
338
|
+
return -1;
|
339
|
+
}
|
340
|
+
#endif
|
341
|
+
|
342
|
+
return 0;
|
343
|
+
}
|
344
|
+
|
345
|
+
static int
|
346
|
+
FcFStatFs (int fd, FcStatFS *statb)
|
347
|
+
{
|
348
|
+
const char *p = NULL;
|
349
|
+
int ret = -1;
|
350
|
+
FcBool flag = FcFalse;
|
351
|
+
|
352
|
+
#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
|
353
|
+
struct statvfs buf;
|
354
|
+
|
355
|
+
memset (statb, 0, sizeof (FcStatFS));
|
356
|
+
|
357
|
+
if ((ret = fstatvfs (fd, &buf)) == 0)
|
358
|
+
{
|
359
|
+
# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
|
360
|
+
p = buf.f_basetype;
|
361
|
+
# elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
|
362
|
+
p = buf.f_fstypename;
|
363
|
+
# endif
|
364
|
+
}
|
365
|
+
#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
|
366
|
+
struct statfs buf;
|
367
|
+
|
368
|
+
memset (statb, 0, sizeof (FcStatFS));
|
369
|
+
|
370
|
+
if ((ret = fstatfs (fd, &buf)) == 0)
|
371
|
+
{
|
372
|
+
# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
|
373
|
+
statb->is_remote_fs = !(buf.f_flags & MNT_LOCAL);
|
374
|
+
flag = FcTrue;
|
375
|
+
# endif
|
376
|
+
# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
|
377
|
+
p = buf.f_fstypename;
|
378
|
+
# elif defined(__linux__)
|
379
|
+
switch (buf.f_type)
|
380
|
+
{
|
381
|
+
case 0x6969: /* nfs */
|
382
|
+
statb->is_remote_fs = FcTrue;
|
383
|
+
break;
|
384
|
+
case 0x4d44: /* fat */
|
385
|
+
statb->is_mtime_broken = FcTrue;
|
386
|
+
break;
|
387
|
+
default:
|
388
|
+
break;
|
389
|
+
}
|
390
|
+
|
391
|
+
return ret;
|
392
|
+
# else
|
393
|
+
# error "BUG: No way to figure out with fstatfs()"
|
394
|
+
# endif
|
395
|
+
}
|
396
|
+
#endif
|
397
|
+
if (p)
|
398
|
+
{
|
399
|
+
if (!flag && strcmp (p, "nfs") == 0)
|
400
|
+
statb->is_remote_fs = FcTrue;
|
401
|
+
if (strcmp (p, "msdosfs") == 0 ||
|
402
|
+
strcmp (p, "pcfs") == 0)
|
403
|
+
statb->is_mtime_broken = FcTrue;
|
404
|
+
}
|
405
|
+
|
406
|
+
return ret;
|
407
|
+
}
|
408
|
+
|
409
|
+
FcBool
|
410
|
+
FcIsFsMmapSafe (int fd)
|
411
|
+
{
|
412
|
+
FcStatFS statb;
|
413
|
+
|
414
|
+
if (FcFStatFs (fd, &statb) < 0)
|
415
|
+
return FcTrue;
|
416
|
+
|
417
|
+
return !statb.is_remote_fs;
|
418
|
+
}
|
419
|
+
|
420
|
+
FcBool
|
421
|
+
FcIsFsMtimeBroken (const FcChar8 *dir)
|
422
|
+
{
|
423
|
+
int fd = FcOpen ((const char *) dir, O_RDONLY);
|
424
|
+
|
425
|
+
if (fd != -1)
|
426
|
+
{
|
427
|
+
FcStatFS statb;
|
428
|
+
int ret = FcFStatFs (fd, &statb);
|
429
|
+
|
430
|
+
close (fd);
|
431
|
+
if (ret < 0)
|
432
|
+
return FcFalse;
|
433
|
+
|
434
|
+
return statb.is_mtime_broken;
|
435
|
+
}
|
436
|
+
|
437
|
+
return FcFalse;
|
438
|
+
}
|
439
|
+
|
440
|
+
#define __fcstat__
|
441
|
+
#include "fcaliastail.h"
|
442
|
+
#undef __fcstat__
|
@@ -0,0 +1,1371 @@
|
|
1
|
+
/*
|
2
|
+
* fontconfig/src/fcstr.c
|
3
|
+
*
|
4
|
+
* Copyright © 2000 Keith Packard
|
5
|
+
*
|
6
|
+
* Permission to use, copy, modify, distribute, and sell this software and its
|
7
|
+
* documentation for any purpose is hereby granted without fee, provided that
|
8
|
+
* the above copyright notice appear in all copies and that both that
|
9
|
+
* copyright notice and this permission notice appear in supporting
|
10
|
+
* documentation, and that the name of the author(s) not be used in
|
11
|
+
* advertising or publicity pertaining to distribution of the software without
|
12
|
+
* specific, written prior permission. The authors make no
|
13
|
+
* representations about the suitability of this software for any purpose. It
|
14
|
+
* is provided "as is" without express or implied warranty.
|
15
|
+
*
|
16
|
+
* THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
17
|
+
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
18
|
+
* EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
19
|
+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
20
|
+
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
21
|
+
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
22
|
+
* PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
25
|
+
#include "fcint.h"
|
26
|
+
#include <stdlib.h>
|
27
|
+
#include <ctype.h>
|
28
|
+
#include <string.h>
|
29
|
+
|
30
|
+
|
31
|
+
/* Objects MT-safe for readonly access. */
|
32
|
+
|
33
|
+
FcChar8 *
|
34
|
+
FcStrCopy (const FcChar8 *s)
|
35
|
+
{
|
36
|
+
return FcStrdup (s);
|
37
|
+
}
|
38
|
+
|
39
|
+
FcChar8 *
|
40
|
+
FcStrPlus (const FcChar8 *s1, const FcChar8 *s2)
|
41
|
+
{
|
42
|
+
int s1l = strlen ((char *) s1);
|
43
|
+
int s2l = strlen ((char *) s2);
|
44
|
+
int l = s1l + s2l + 1;
|
45
|
+
FcChar8 *s = malloc (l);
|
46
|
+
|
47
|
+
if (!s)
|
48
|
+
return 0;
|
49
|
+
memcpy (s, s1, s1l);
|
50
|
+
memcpy (s + s1l, s2, s2l + 1);
|
51
|
+
return s;
|
52
|
+
}
|
53
|
+
|
54
|
+
void
|
55
|
+
FcStrFree (FcChar8 *s)
|
56
|
+
{
|
57
|
+
free (s);
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
#include "../fc-case/fccase.h"
|
62
|
+
|
63
|
+
#define FcCaseFoldUpperCount(cf) \
|
64
|
+
((cf)->method == FC_CASE_FOLD_FULL ? 1 : (cf)->count)
|
65
|
+
|
66
|
+
typedef struct _FcCaseWalker {
|
67
|
+
const FcChar8 *read;
|
68
|
+
const FcChar8 *src;
|
69
|
+
FcChar8 utf8[FC_MAX_CASE_FOLD_CHARS + 1];
|
70
|
+
} FcCaseWalker;
|
71
|
+
|
72
|
+
static void
|
73
|
+
FcStrCaseWalkerInit (const FcChar8 *src, FcCaseWalker *w)
|
74
|
+
{
|
75
|
+
w->src = src;
|
76
|
+
w->read = 0;
|
77
|
+
}
|
78
|
+
|
79
|
+
static FcChar8
|
80
|
+
FcStrCaseWalkerLong (FcCaseWalker *w, FcChar8 r)
|
81
|
+
{
|
82
|
+
FcChar32 ucs4;
|
83
|
+
int slen;
|
84
|
+
int len = strlen((char*)w->src);
|
85
|
+
|
86
|
+
slen = FcUtf8ToUcs4 (w->src - 1, &ucs4, len + 1);
|
87
|
+
if (slen <= 0)
|
88
|
+
return r;
|
89
|
+
if (FC_MIN_FOLD_CHAR <= ucs4 && ucs4 <= FC_MAX_FOLD_CHAR)
|
90
|
+
{
|
91
|
+
int min = 0;
|
92
|
+
int max = FC_NUM_CASE_FOLD;
|
93
|
+
|
94
|
+
while (min <= max)
|
95
|
+
{
|
96
|
+
int mid = (min + max) >> 1;
|
97
|
+
FcChar32 low = fcCaseFold[mid].upper;
|
98
|
+
FcChar32 high = low + FcCaseFoldUpperCount (&fcCaseFold[mid]);
|
99
|
+
|
100
|
+
if (high <= ucs4)
|
101
|
+
min = mid + 1;
|
102
|
+
else if (ucs4 < low)
|
103
|
+
max = mid - 1;
|
104
|
+
else
|
105
|
+
{
|
106
|
+
const FcCaseFold *fold = &fcCaseFold[mid];
|
107
|
+
int dlen;
|
108
|
+
|
109
|
+
switch (fold->method) {
|
110
|
+
case FC_CASE_FOLD_EVEN_ODD:
|
111
|
+
if ((ucs4 & 1) != (fold->upper & 1))
|
112
|
+
return r;
|
113
|
+
/* fall through ... */
|
114
|
+
default:
|
115
|
+
dlen = FcUcs4ToUtf8 (ucs4 + fold->offset, w->utf8);
|
116
|
+
break;
|
117
|
+
case FC_CASE_FOLD_FULL:
|
118
|
+
dlen = fold->count;
|
119
|
+
memcpy (w->utf8, fcCaseFoldChars + fold->offset, dlen);
|
120
|
+
break;
|
121
|
+
}
|
122
|
+
|
123
|
+
/* consume rest of src utf-8 bytes */
|
124
|
+
w->src += slen - 1;
|
125
|
+
|
126
|
+
/* read from temp buffer */
|
127
|
+
w->utf8[dlen] = '\0';
|
128
|
+
w->read = w->utf8;
|
129
|
+
return *w->read++;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
}
|
133
|
+
return r;
|
134
|
+
}
|
135
|
+
|
136
|
+
static FcChar8
|
137
|
+
FcStrCaseWalkerNext (FcCaseWalker *w, const char *delims)
|
138
|
+
{
|
139
|
+
FcChar8 r;
|
140
|
+
|
141
|
+
if (w->read)
|
142
|
+
{
|
143
|
+
if ((r = *w->read++))
|
144
|
+
return r;
|
145
|
+
w->read = 0;
|
146
|
+
}
|
147
|
+
do
|
148
|
+
{
|
149
|
+
r = *w->src++;
|
150
|
+
} while (r != 0 && delims && strchr (delims, r));
|
151
|
+
|
152
|
+
if ((r & 0xc0) == 0xc0)
|
153
|
+
return FcStrCaseWalkerLong (w, r);
|
154
|
+
if ('A' <= r && r <= 'Z')
|
155
|
+
r = r - 'A' + 'a';
|
156
|
+
return r;
|
157
|
+
}
|
158
|
+
|
159
|
+
FcChar8 *
|
160
|
+
FcStrDowncase (const FcChar8 *s)
|
161
|
+
{
|
162
|
+
FcCaseWalker w;
|
163
|
+
int len = 0;
|
164
|
+
FcChar8 *dst, *d;
|
165
|
+
|
166
|
+
FcStrCaseWalkerInit (s, &w);
|
167
|
+
while (FcStrCaseWalkerNext (&w, NULL))
|
168
|
+
len++;
|
169
|
+
d = dst = malloc (len + 1);
|
170
|
+
if (!d)
|
171
|
+
return 0;
|
172
|
+
FcStrCaseWalkerInit (s, &w);
|
173
|
+
while ((*d++ = FcStrCaseWalkerNext (&w, NULL)));
|
174
|
+
return dst;
|
175
|
+
}
|
176
|
+
|
177
|
+
int
|
178
|
+
FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2)
|
179
|
+
{
|
180
|
+
FcCaseWalker w1, w2;
|
181
|
+
FcChar8 c1, c2;
|
182
|
+
|
183
|
+
if (s1 == s2) return 0;
|
184
|
+
|
185
|
+
FcStrCaseWalkerInit (s1, &w1);
|
186
|
+
FcStrCaseWalkerInit (s2, &w2);
|
187
|
+
|
188
|
+
for (;;)
|
189
|
+
{
|
190
|
+
c1 = FcStrCaseWalkerNext (&w1, NULL);
|
191
|
+
c2 = FcStrCaseWalkerNext (&w2, NULL);
|
192
|
+
if (!c1 || (c1 != c2))
|
193
|
+
break;
|
194
|
+
}
|
195
|
+
return (int) c1 - (int) c2;
|
196
|
+
}
|
197
|
+
|
198
|
+
int
|
199
|
+
FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2)
|
200
|
+
{
|
201
|
+
return FcStrCmpIgnoreCaseAndDelims (s1, s2, (const FcChar8 *)" ");
|
202
|
+
}
|
203
|
+
|
204
|
+
int
|
205
|
+
FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims)
|
206
|
+
{
|
207
|
+
FcCaseWalker w1, w2;
|
208
|
+
FcChar8 c1, c2;
|
209
|
+
|
210
|
+
if (s1 == s2) return 0;
|
211
|
+
|
212
|
+
FcStrCaseWalkerInit (s1, &w1);
|
213
|
+
FcStrCaseWalkerInit (s2, &w2);
|
214
|
+
|
215
|
+
for (;;)
|
216
|
+
{
|
217
|
+
c1 = FcStrCaseWalkerNext (&w1, (const char *)delims);
|
218
|
+
c2 = FcStrCaseWalkerNext (&w2, (const char *)delims);
|
219
|
+
if (!c1 || (c1 != c2))
|
220
|
+
break;
|
221
|
+
}
|
222
|
+
return (int) c1 - (int) c2;
|
223
|
+
}
|
224
|
+
|
225
|
+
int
|
226
|
+
FcStrCmp (const FcChar8 *s1, const FcChar8 *s2)
|
227
|
+
{
|
228
|
+
FcChar8 c1, c2;
|
229
|
+
|
230
|
+
if (s1 == s2)
|
231
|
+
return 0;
|
232
|
+
for (;;)
|
233
|
+
{
|
234
|
+
c1 = *s1++;
|
235
|
+
c2 = *s2++;
|
236
|
+
if (!c1 || c1 != c2)
|
237
|
+
break;
|
238
|
+
}
|
239
|
+
return (int) c1 - (int) c2;
|
240
|
+
}
|
241
|
+
|
242
|
+
/*
|
243
|
+
* Return a hash value for a string
|
244
|
+
*/
|
245
|
+
|
246
|
+
FcChar32
|
247
|
+
FcStrHashIgnoreCase (const FcChar8 *s)
|
248
|
+
{
|
249
|
+
FcChar32 h = 0;
|
250
|
+
FcCaseWalker w;
|
251
|
+
FcChar8 c;
|
252
|
+
|
253
|
+
FcStrCaseWalkerInit (s, &w);
|
254
|
+
while ((c = FcStrCaseWalkerNext (&w, NULL)))
|
255
|
+
h = ((h << 3) ^ (h >> 3)) ^ c;
|
256
|
+
return h;
|
257
|
+
}
|
258
|
+
|
259
|
+
/*
|
260
|
+
* Is the head of s1 equal to s2?
|
261
|
+
*/
|
262
|
+
|
263
|
+
static FcBool
|
264
|
+
FcStrIsAtIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2)
|
265
|
+
{
|
266
|
+
FcCaseWalker w1, w2;
|
267
|
+
FcChar8 c1, c2;
|
268
|
+
|
269
|
+
FcStrCaseWalkerInit (s1, &w1);
|
270
|
+
FcStrCaseWalkerInit (s2, &w2);
|
271
|
+
|
272
|
+
for (;;)
|
273
|
+
{
|
274
|
+
c1 = FcStrCaseWalkerNext (&w1, " ");
|
275
|
+
c2 = FcStrCaseWalkerNext (&w2, " ");
|
276
|
+
if (!c1 || (c1 != c2))
|
277
|
+
break;
|
278
|
+
}
|
279
|
+
return c1 == c2 || !c2;
|
280
|
+
}
|
281
|
+
|
282
|
+
/*
|
283
|
+
* Does s1 contain an instance of s2 (ignoring blanks and case)?
|
284
|
+
*/
|
285
|
+
|
286
|
+
const FcChar8 *
|
287
|
+
FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2)
|
288
|
+
{
|
289
|
+
while (*s1)
|
290
|
+
{
|
291
|
+
if (FcStrIsAtIgnoreBlanksAndCase (s1, s2))
|
292
|
+
return s1;
|
293
|
+
s1++;
|
294
|
+
}
|
295
|
+
return 0;
|
296
|
+
}
|
297
|
+
|
298
|
+
static FcBool
|
299
|
+
FcCharIsPunct (const FcChar8 c)
|
300
|
+
{
|
301
|
+
if (c < '0')
|
302
|
+
return FcTrue;
|
303
|
+
if (c <= '9')
|
304
|
+
return FcFalse;
|
305
|
+
if (c < 'A')
|
306
|
+
return FcTrue;
|
307
|
+
if (c <= 'Z')
|
308
|
+
return FcFalse;
|
309
|
+
if (c < 'a')
|
310
|
+
return FcTrue;
|
311
|
+
if (c <= 'z')
|
312
|
+
return FcFalse;
|
313
|
+
if (c <= '~')
|
314
|
+
return FcTrue;
|
315
|
+
return FcFalse;
|
316
|
+
}
|
317
|
+
|
318
|
+
/*
|
319
|
+
* Is the head of s1 equal to s2?
|
320
|
+
*/
|
321
|
+
|
322
|
+
static FcBool
|
323
|
+
FcStrIsAtIgnoreCase (const FcChar8 *s1, const FcChar8 *s2)
|
324
|
+
{
|
325
|
+
FcCaseWalker w1, w2;
|
326
|
+
FcChar8 c1, c2;
|
327
|
+
|
328
|
+
FcStrCaseWalkerInit (s1, &w1);
|
329
|
+
FcStrCaseWalkerInit (s2, &w2);
|
330
|
+
|
331
|
+
for (;;)
|
332
|
+
{
|
333
|
+
c1 = FcStrCaseWalkerNext (&w1, NULL);
|
334
|
+
c2 = FcStrCaseWalkerNext (&w2, NULL);
|
335
|
+
if (!c1 || (c1 != c2))
|
336
|
+
break;
|
337
|
+
}
|
338
|
+
return c1 == c2 || !c2;
|
339
|
+
}
|
340
|
+
|
341
|
+
/*
|
342
|
+
* Does s1 contain an instance of s2 (ignoring blanks and case)?
|
343
|
+
*/
|
344
|
+
|
345
|
+
const FcChar8 *
|
346
|
+
FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2)
|
347
|
+
{
|
348
|
+
while (*s1)
|
349
|
+
{
|
350
|
+
if (FcStrIsAtIgnoreCase (s1, s2))
|
351
|
+
return s1;
|
352
|
+
s1++;
|
353
|
+
}
|
354
|
+
return 0;
|
355
|
+
}
|
356
|
+
|
357
|
+
/*
|
358
|
+
* Does s1 contain an instance of s2 on a word boundary (ignoring case)?
|
359
|
+
*/
|
360
|
+
|
361
|
+
const FcChar8 *
|
362
|
+
FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2)
|
363
|
+
{
|
364
|
+
FcBool wordStart = FcTrue;
|
365
|
+
int s1len = strlen ((char *) s1);
|
366
|
+
int s2len = strlen ((char *) s2);
|
367
|
+
|
368
|
+
while (s1len >= s2len)
|
369
|
+
{
|
370
|
+
if (wordStart &&
|
371
|
+
FcStrIsAtIgnoreCase (s1, s2) &&
|
372
|
+
(s1len == s2len || FcCharIsPunct (s1[s2len])))
|
373
|
+
{
|
374
|
+
return s1;
|
375
|
+
}
|
376
|
+
wordStart = FcFalse;
|
377
|
+
if (FcCharIsPunct (*s1))
|
378
|
+
wordStart = FcTrue;
|
379
|
+
s1++;
|
380
|
+
s1len--;
|
381
|
+
}
|
382
|
+
return 0;
|
383
|
+
}
|
384
|
+
|
385
|
+
/*
|
386
|
+
* returns the number of strings (ignoring delimitors and case) being matched
|
387
|
+
*/
|
388
|
+
|
389
|
+
int
|
390
|
+
FcStrMatchIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims)
|
391
|
+
{
|
392
|
+
FcCaseWalker w1, w2;
|
393
|
+
FcChar8 c1, c2;
|
394
|
+
|
395
|
+
if (s1 == s2) return 0;
|
396
|
+
|
397
|
+
FcStrCaseWalkerInit (s1, &w1);
|
398
|
+
FcStrCaseWalkerInit (s2, &w2);
|
399
|
+
|
400
|
+
for (;;)
|
401
|
+
{
|
402
|
+
c1 = FcStrCaseWalkerNext (&w1, (const char *)delims);
|
403
|
+
c2 = FcStrCaseWalkerNext (&w2, (const char *)delims);
|
404
|
+
if (!c1 || (c1 != c2))
|
405
|
+
break;
|
406
|
+
}
|
407
|
+
return w1.src - s1 - 1;
|
408
|
+
}
|
409
|
+
|
410
|
+
FcBool
|
411
|
+
FcStrGlobMatch (const FcChar8 *glob,
|
412
|
+
const FcChar8 *string)
|
413
|
+
{
|
414
|
+
FcChar8 c;
|
415
|
+
|
416
|
+
while ((c = *glob++))
|
417
|
+
{
|
418
|
+
switch (c) {
|
419
|
+
case '*':
|
420
|
+
/* short circuit common case */
|
421
|
+
if (!*glob)
|
422
|
+
return FcTrue;
|
423
|
+
/* short circuit another common case */
|
424
|
+
if (strchr ((char *) glob, '*') == 0)
|
425
|
+
{
|
426
|
+
size_t l1, l2;
|
427
|
+
|
428
|
+
l1 = strlen ((char *) string);
|
429
|
+
l2 = strlen ((char *) glob);
|
430
|
+
if (l1 < l2)
|
431
|
+
return FcFalse;
|
432
|
+
string += (l1 - l2);
|
433
|
+
}
|
434
|
+
while (*string)
|
435
|
+
{
|
436
|
+
if (FcStrGlobMatch (glob, string))
|
437
|
+
return FcTrue;
|
438
|
+
string++;
|
439
|
+
}
|
440
|
+
return FcFalse;
|
441
|
+
case '?':
|
442
|
+
if (*string++ == '\0')
|
443
|
+
return FcFalse;
|
444
|
+
break;
|
445
|
+
default:
|
446
|
+
if (*string++ != c)
|
447
|
+
return FcFalse;
|
448
|
+
break;
|
449
|
+
}
|
450
|
+
}
|
451
|
+
return *string == '\0';
|
452
|
+
}
|
453
|
+
|
454
|
+
const FcChar8 *
|
455
|
+
FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2)
|
456
|
+
{
|
457
|
+
FcCaseWalker w1, w2;
|
458
|
+
FcChar8 c1, c2;
|
459
|
+
const FcChar8 *cur;
|
460
|
+
|
461
|
+
if (!s1 || !s2)
|
462
|
+
return 0;
|
463
|
+
|
464
|
+
if (s1 == s2)
|
465
|
+
return s1;
|
466
|
+
|
467
|
+
FcStrCaseWalkerInit (s1, &w1);
|
468
|
+
FcStrCaseWalkerInit (s2, &w2);
|
469
|
+
|
470
|
+
c2 = FcStrCaseWalkerNext (&w2, NULL);
|
471
|
+
|
472
|
+
for (;;)
|
473
|
+
{
|
474
|
+
cur = w1.src;
|
475
|
+
c1 = FcStrCaseWalkerNext (&w1, NULL);
|
476
|
+
if (!c1)
|
477
|
+
break;
|
478
|
+
if (c1 == c2)
|
479
|
+
{
|
480
|
+
FcCaseWalker w1t = w1;
|
481
|
+
FcCaseWalker w2t = w2;
|
482
|
+
FcChar8 c1t, c2t;
|
483
|
+
|
484
|
+
for (;;)
|
485
|
+
{
|
486
|
+
c1t = FcStrCaseWalkerNext (&w1t, NULL);
|
487
|
+
c2t = FcStrCaseWalkerNext (&w2t, NULL);
|
488
|
+
|
489
|
+
if (!c2t)
|
490
|
+
return cur;
|
491
|
+
if (c2t != c1t)
|
492
|
+
break;
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
return 0;
|
497
|
+
}
|
498
|
+
|
499
|
+
const FcChar8 *
|
500
|
+
FcStrStr (const FcChar8 *s1, const FcChar8 *s2)
|
501
|
+
{
|
502
|
+
FcChar8 c1, c2;
|
503
|
+
const FcChar8 * p = s1;
|
504
|
+
const FcChar8 * b = s2;
|
505
|
+
|
506
|
+
if (!s1 || !s2)
|
507
|
+
return 0;
|
508
|
+
|
509
|
+
if (s1 == s2)
|
510
|
+
return s1;
|
511
|
+
|
512
|
+
again:
|
513
|
+
c2 = *s2++;
|
514
|
+
|
515
|
+
if (!c2)
|
516
|
+
return 0;
|
517
|
+
|
518
|
+
for (;;)
|
519
|
+
{
|
520
|
+
p = s1;
|
521
|
+
c1 = *s1++;
|
522
|
+
if (!c1 || c1 == c2)
|
523
|
+
break;
|
524
|
+
}
|
525
|
+
|
526
|
+
if (c1 != c2)
|
527
|
+
return 0;
|
528
|
+
|
529
|
+
for (;;)
|
530
|
+
{
|
531
|
+
c1 = *s1;
|
532
|
+
c2 = *s2;
|
533
|
+
if (c1 && c2 && c1 != c2)
|
534
|
+
{
|
535
|
+
s1 = p + 1;
|
536
|
+
s2 = b;
|
537
|
+
goto again;
|
538
|
+
}
|
539
|
+
if (!c2)
|
540
|
+
return p;
|
541
|
+
if (!c1)
|
542
|
+
return 0;
|
543
|
+
++ s1;
|
544
|
+
++ s2;
|
545
|
+
}
|
546
|
+
/* never reached. */
|
547
|
+
}
|
548
|
+
|
549
|
+
int
|
550
|
+
FcUtf8ToUcs4 (const FcChar8 *src_orig,
|
551
|
+
FcChar32 *dst,
|
552
|
+
int len)
|
553
|
+
{
|
554
|
+
const FcChar8 *src = src_orig;
|
555
|
+
FcChar8 s;
|
556
|
+
int extra;
|
557
|
+
FcChar32 result;
|
558
|
+
|
559
|
+
if (len == 0)
|
560
|
+
return 0;
|
561
|
+
|
562
|
+
s = *src++;
|
563
|
+
len--;
|
564
|
+
|
565
|
+
if (!(s & 0x80))
|
566
|
+
{
|
567
|
+
result = s;
|
568
|
+
extra = 0;
|
569
|
+
}
|
570
|
+
else if (!(s & 0x40))
|
571
|
+
{
|
572
|
+
return -1;
|
573
|
+
}
|
574
|
+
else if (!(s & 0x20))
|
575
|
+
{
|
576
|
+
result = s & 0x1f;
|
577
|
+
extra = 1;
|
578
|
+
}
|
579
|
+
else if (!(s & 0x10))
|
580
|
+
{
|
581
|
+
result = s & 0xf;
|
582
|
+
extra = 2;
|
583
|
+
}
|
584
|
+
else if (!(s & 0x08))
|
585
|
+
{
|
586
|
+
result = s & 0x07;
|
587
|
+
extra = 3;
|
588
|
+
}
|
589
|
+
else if (!(s & 0x04))
|
590
|
+
{
|
591
|
+
result = s & 0x03;
|
592
|
+
extra = 4;
|
593
|
+
}
|
594
|
+
else if ( ! (s & 0x02))
|
595
|
+
{
|
596
|
+
result = s & 0x01;
|
597
|
+
extra = 5;
|
598
|
+
}
|
599
|
+
else
|
600
|
+
{
|
601
|
+
return -1;
|
602
|
+
}
|
603
|
+
if (extra > len)
|
604
|
+
return -1;
|
605
|
+
|
606
|
+
while (extra--)
|
607
|
+
{
|
608
|
+
result <<= 6;
|
609
|
+
s = *src++;
|
610
|
+
|
611
|
+
if ((s & 0xc0) != 0x80)
|
612
|
+
return -1;
|
613
|
+
|
614
|
+
result |= s & 0x3f;
|
615
|
+
}
|
616
|
+
*dst = result;
|
617
|
+
return src - src_orig;
|
618
|
+
}
|
619
|
+
|
620
|
+
FcBool
|
621
|
+
FcUtf8Len (const FcChar8 *string,
|
622
|
+
int len,
|
623
|
+
int *nchar,
|
624
|
+
int *wchar)
|
625
|
+
{
|
626
|
+
int n;
|
627
|
+
int clen;
|
628
|
+
FcChar32 c;
|
629
|
+
FcChar32 max;
|
630
|
+
|
631
|
+
n = 0;
|
632
|
+
max = 0;
|
633
|
+
while (len)
|
634
|
+
{
|
635
|
+
clen = FcUtf8ToUcs4 (string, &c, len);
|
636
|
+
if (clen <= 0) /* malformed UTF8 string */
|
637
|
+
return FcFalse;
|
638
|
+
if (c > max)
|
639
|
+
max = c;
|
640
|
+
string += clen;
|
641
|
+
len -= clen;
|
642
|
+
n++;
|
643
|
+
}
|
644
|
+
*nchar = n;
|
645
|
+
if (max >= 0x10000)
|
646
|
+
*wchar = 4;
|
647
|
+
else if (max > 0x100)
|
648
|
+
*wchar = 2;
|
649
|
+
else
|
650
|
+
*wchar = 1;
|
651
|
+
return FcTrue;
|
652
|
+
}
|
653
|
+
|
654
|
+
int
|
655
|
+
FcUcs4ToUtf8 (FcChar32 ucs4,
|
656
|
+
FcChar8 dest[FC_UTF8_MAX_LEN])
|
657
|
+
{
|
658
|
+
int bits;
|
659
|
+
FcChar8 *d = dest;
|
660
|
+
|
661
|
+
if (ucs4 < 0x80) { *d++= ucs4; bits= -6; }
|
662
|
+
else if (ucs4 < 0x800) { *d++= ((ucs4 >> 6) & 0x1F) | 0xC0; bits= 0; }
|
663
|
+
else if (ucs4 < 0x10000) { *d++= ((ucs4 >> 12) & 0x0F) | 0xE0; bits= 6; }
|
664
|
+
else if (ucs4 < 0x200000) { *d++= ((ucs4 >> 18) & 0x07) | 0xF0; bits= 12; }
|
665
|
+
else if (ucs4 < 0x4000000) { *d++= ((ucs4 >> 24) & 0x03) | 0xF8; bits= 18; }
|
666
|
+
else if (ucs4 < 0x80000000) { *d++= ((ucs4 >> 30) & 0x01) | 0xFC; bits= 24; }
|
667
|
+
else return 0;
|
668
|
+
|
669
|
+
for ( ; bits >= 0; bits-= 6) {
|
670
|
+
*d++= ((ucs4 >> bits) & 0x3F) | 0x80;
|
671
|
+
}
|
672
|
+
return d - dest;
|
673
|
+
}
|
674
|
+
|
675
|
+
#define GetUtf16(src,endian) \
|
676
|
+
((FcChar16) ((src)[endian == FcEndianBig ? 0 : 1] << 8) | \
|
677
|
+
(FcChar16) ((src)[endian == FcEndianBig ? 1 : 0]))
|
678
|
+
|
679
|
+
int
|
680
|
+
FcUtf16ToUcs4 (const FcChar8 *src_orig,
|
681
|
+
FcEndian endian,
|
682
|
+
FcChar32 *dst,
|
683
|
+
int len) /* in bytes */
|
684
|
+
{
|
685
|
+
const FcChar8 *src = src_orig;
|
686
|
+
FcChar16 a, b;
|
687
|
+
FcChar32 result;
|
688
|
+
|
689
|
+
if (len < 2)
|
690
|
+
return 0;
|
691
|
+
|
692
|
+
a = GetUtf16 (src, endian); src += 2; len -= 2;
|
693
|
+
|
694
|
+
/*
|
695
|
+
* Check for surrogate
|
696
|
+
*/
|
697
|
+
if ((a & 0xfc00) == 0xd800)
|
698
|
+
{
|
699
|
+
if (len < 2)
|
700
|
+
return 0;
|
701
|
+
b = GetUtf16 (src, endian); src += 2; len -= 2;
|
702
|
+
/*
|
703
|
+
* Check for invalid surrogate sequence
|
704
|
+
*/
|
705
|
+
if ((b & 0xfc00) != 0xdc00)
|
706
|
+
return 0;
|
707
|
+
result = ((((FcChar32) a & 0x3ff) << 10) |
|
708
|
+
((FcChar32) b & 0x3ff)) + 0x10000;
|
709
|
+
}
|
710
|
+
else
|
711
|
+
result = a;
|
712
|
+
*dst = result;
|
713
|
+
return src - src_orig;
|
714
|
+
}
|
715
|
+
|
716
|
+
FcBool
|
717
|
+
FcUtf16Len (const FcChar8 *string,
|
718
|
+
FcEndian endian,
|
719
|
+
int len, /* in bytes */
|
720
|
+
int *nchar,
|
721
|
+
int *wchar)
|
722
|
+
{
|
723
|
+
int n;
|
724
|
+
int clen;
|
725
|
+
FcChar32 c;
|
726
|
+
FcChar32 max;
|
727
|
+
|
728
|
+
n = 0;
|
729
|
+
max = 0;
|
730
|
+
while (len)
|
731
|
+
{
|
732
|
+
clen = FcUtf16ToUcs4 (string, endian, &c, len);
|
733
|
+
if (clen <= 0) /* malformed UTF8 string */
|
734
|
+
return FcFalse;
|
735
|
+
if (c > max)
|
736
|
+
max = c;
|
737
|
+
string += clen;
|
738
|
+
len -= clen;
|
739
|
+
n++;
|
740
|
+
}
|
741
|
+
*nchar = n;
|
742
|
+
if (max >= 0x10000)
|
743
|
+
*wchar = 4;
|
744
|
+
else if (max > 0x100)
|
745
|
+
*wchar = 2;
|
746
|
+
else
|
747
|
+
*wchar = 1;
|
748
|
+
return FcTrue;
|
749
|
+
}
|
750
|
+
|
751
|
+
void
|
752
|
+
FcStrBufInit (FcStrBuf *buf, FcChar8 *init, int size)
|
753
|
+
{
|
754
|
+
if (init)
|
755
|
+
{
|
756
|
+
buf->buf = init;
|
757
|
+
buf->size = size;
|
758
|
+
} else
|
759
|
+
{
|
760
|
+
buf->buf = buf->buf_static;
|
761
|
+
buf->size = sizeof (buf->buf_static);
|
762
|
+
}
|
763
|
+
buf->allocated = FcFalse;
|
764
|
+
buf->failed = FcFalse;
|
765
|
+
buf->len = 0;
|
766
|
+
}
|
767
|
+
|
768
|
+
void
|
769
|
+
FcStrBufDestroy (FcStrBuf *buf)
|
770
|
+
{
|
771
|
+
if (buf->allocated)
|
772
|
+
{
|
773
|
+
free (buf->buf);
|
774
|
+
FcStrBufInit (buf, 0, 0);
|
775
|
+
}
|
776
|
+
}
|
777
|
+
|
778
|
+
FcChar8 *
|
779
|
+
FcStrBufDone (FcStrBuf *buf)
|
780
|
+
{
|
781
|
+
FcChar8 *ret;
|
782
|
+
|
783
|
+
if (buf->failed)
|
784
|
+
ret = NULL;
|
785
|
+
else
|
786
|
+
ret = malloc (buf->len + 1);
|
787
|
+
if (ret)
|
788
|
+
{
|
789
|
+
memcpy (ret, buf->buf, buf->len);
|
790
|
+
ret[buf->len] = '\0';
|
791
|
+
}
|
792
|
+
FcStrBufDestroy (buf);
|
793
|
+
return ret;
|
794
|
+
}
|
795
|
+
|
796
|
+
FcChar8 *
|
797
|
+
FcStrBufDoneStatic (FcStrBuf *buf)
|
798
|
+
{
|
799
|
+
FcStrBufChar (buf, '\0');
|
800
|
+
|
801
|
+
if (buf->failed)
|
802
|
+
return NULL;
|
803
|
+
|
804
|
+
return buf->buf;
|
805
|
+
}
|
806
|
+
|
807
|
+
FcBool
|
808
|
+
FcStrBufChar (FcStrBuf *buf, FcChar8 c)
|
809
|
+
{
|
810
|
+
if (buf->len == buf->size)
|
811
|
+
{
|
812
|
+
FcChar8 *new;
|
813
|
+
int size;
|
814
|
+
|
815
|
+
if (buf->failed)
|
816
|
+
return FcFalse;
|
817
|
+
|
818
|
+
if (buf->allocated)
|
819
|
+
{
|
820
|
+
size = buf->size * 2;
|
821
|
+
new = realloc (buf->buf, size);
|
822
|
+
}
|
823
|
+
else
|
824
|
+
{
|
825
|
+
size = buf->size + 64;
|
826
|
+
new = malloc (size);
|
827
|
+
if (new)
|
828
|
+
{
|
829
|
+
buf->allocated = FcTrue;
|
830
|
+
memcpy (new, buf->buf, buf->len);
|
831
|
+
}
|
832
|
+
}
|
833
|
+
if (!new)
|
834
|
+
{
|
835
|
+
buf->failed = FcTrue;
|
836
|
+
return FcFalse;
|
837
|
+
}
|
838
|
+
buf->size = size;
|
839
|
+
buf->buf = new;
|
840
|
+
}
|
841
|
+
buf->buf[buf->len++] = c;
|
842
|
+
return FcTrue;
|
843
|
+
}
|
844
|
+
|
845
|
+
FcBool
|
846
|
+
FcStrBufString (FcStrBuf *buf, const FcChar8 *s)
|
847
|
+
{
|
848
|
+
FcChar8 c;
|
849
|
+
while ((c = *s++))
|
850
|
+
if (!FcStrBufChar (buf, c))
|
851
|
+
return FcFalse;
|
852
|
+
return FcTrue;
|
853
|
+
}
|
854
|
+
|
855
|
+
FcBool
|
856
|
+
FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len)
|
857
|
+
{
|
858
|
+
while (len-- > 0)
|
859
|
+
if (!FcStrBufChar (buf, *s++))
|
860
|
+
return FcFalse;
|
861
|
+
return FcTrue;
|
862
|
+
}
|
863
|
+
|
864
|
+
FcBool
|
865
|
+
FcStrUsesHome (const FcChar8 *s)
|
866
|
+
{
|
867
|
+
return *s == '~';
|
868
|
+
}
|
869
|
+
|
870
|
+
FcChar8 *
|
871
|
+
FcStrBuildFilename (const FcChar8 *path,
|
872
|
+
...)
|
873
|
+
{
|
874
|
+
va_list ap;
|
875
|
+
FcStrSet *sset;
|
876
|
+
FcStrList *list;
|
877
|
+
FcChar8 *s, *ret = NULL, *p;
|
878
|
+
size_t len = 0;
|
879
|
+
|
880
|
+
if (!path)
|
881
|
+
return NULL;
|
882
|
+
|
883
|
+
sset = FcStrSetCreateEx (FCSS_ALLOW_DUPLICATES | FCSS_GROW_BY_64);
|
884
|
+
if (!sset)
|
885
|
+
return NULL;
|
886
|
+
|
887
|
+
if (!FcStrSetAdd (sset, path))
|
888
|
+
goto bail0;
|
889
|
+
|
890
|
+
va_start (ap, path);
|
891
|
+
while (1)
|
892
|
+
{
|
893
|
+
s = (FcChar8 *)va_arg (ap, FcChar8 *);
|
894
|
+
if (!s)
|
895
|
+
break;
|
896
|
+
if (!FcStrSetAdd (sset, s))
|
897
|
+
goto bail1;
|
898
|
+
}
|
899
|
+
list = FcStrListCreate (sset);
|
900
|
+
while ((s = FcStrListNext (list)))
|
901
|
+
{
|
902
|
+
len += strlen ((const char *)s) + 1;
|
903
|
+
}
|
904
|
+
list->n = 0;
|
905
|
+
ret = malloc (sizeof (FcChar8) * (len + 1));
|
906
|
+
if (!ret)
|
907
|
+
goto bail2;
|
908
|
+
p = ret;
|
909
|
+
while ((s = FcStrListNext (list)))
|
910
|
+
{
|
911
|
+
if (p != ret)
|
912
|
+
{
|
913
|
+
p[0] = FC_DIR_SEPARATOR;
|
914
|
+
p++;
|
915
|
+
}
|
916
|
+
len = strlen ((const char *)s);
|
917
|
+
memcpy (p, s, len);
|
918
|
+
p += len;
|
919
|
+
}
|
920
|
+
*p = 0;
|
921
|
+
|
922
|
+
bail2:
|
923
|
+
FcStrListDone (list);
|
924
|
+
bail1:
|
925
|
+
va_end (ap);
|
926
|
+
bail0:
|
927
|
+
FcStrSetDestroy (sset);
|
928
|
+
|
929
|
+
return ret;
|
930
|
+
}
|
931
|
+
|
932
|
+
FcChar8 *
|
933
|
+
FcStrCopyFilename (const FcChar8 *s)
|
934
|
+
{
|
935
|
+
FcChar8 *new;
|
936
|
+
|
937
|
+
if (*s == '~')
|
938
|
+
{
|
939
|
+
FcChar8 *home = FcConfigHome ();
|
940
|
+
FcChar8 *full;
|
941
|
+
int size;
|
942
|
+
if (!home)
|
943
|
+
return NULL;
|
944
|
+
size = strlen ((char *) home) + strlen ((char *) s);
|
945
|
+
full = (FcChar8 *) malloc (size);
|
946
|
+
if (!full)
|
947
|
+
return NULL;
|
948
|
+
strcpy ((char *) full, (char *) home);
|
949
|
+
strcat ((char *) full, (char *) s + 1);
|
950
|
+
new = FcStrCanonFilename (full);
|
951
|
+
free (full);
|
952
|
+
}
|
953
|
+
else
|
954
|
+
new = FcStrCanonFilename (s);
|
955
|
+
|
956
|
+
return new;
|
957
|
+
}
|
958
|
+
|
959
|
+
FcChar8 *
|
960
|
+
FcStrLastSlash (const FcChar8 *path)
|
961
|
+
{
|
962
|
+
FcChar8 *slash;
|
963
|
+
|
964
|
+
slash = (FcChar8 *) strrchr ((const char *) path, '/');
|
965
|
+
#ifdef _WIN32
|
966
|
+
{
|
967
|
+
FcChar8 *backslash;
|
968
|
+
|
969
|
+
backslash = (FcChar8 *) strrchr ((const char *) path, '\\');
|
970
|
+
if (!slash || (backslash && backslash > slash))
|
971
|
+
slash = backslash;
|
972
|
+
}
|
973
|
+
#endif
|
974
|
+
|
975
|
+
return slash;
|
976
|
+
}
|
977
|
+
|
978
|
+
FcChar8 *
|
979
|
+
FcStrDirname (const FcChar8 *file)
|
980
|
+
{
|
981
|
+
FcChar8 *slash;
|
982
|
+
FcChar8 *dir;
|
983
|
+
|
984
|
+
slash = FcStrLastSlash (file);
|
985
|
+
if (!slash)
|
986
|
+
return FcStrCopy ((FcChar8 *) ".");
|
987
|
+
dir = malloc ((slash - file) + 1);
|
988
|
+
if (!dir)
|
989
|
+
return 0;
|
990
|
+
strncpy ((char *) dir, (const char *) file, slash - file);
|
991
|
+
dir[slash - file] = '\0';
|
992
|
+
return dir;
|
993
|
+
}
|
994
|
+
|
995
|
+
FcChar8 *
|
996
|
+
FcStrBasename (const FcChar8 *file)
|
997
|
+
{
|
998
|
+
FcChar8 *slash;
|
999
|
+
|
1000
|
+
slash = FcStrLastSlash (file);
|
1001
|
+
if (!slash)
|
1002
|
+
return FcStrCopy (file);
|
1003
|
+
return FcStrCopy (slash + 1);
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
static FcChar8 *
|
1007
|
+
FcStrCanonAbsoluteFilename (const FcChar8 *s)
|
1008
|
+
{
|
1009
|
+
FcChar8 *file;
|
1010
|
+
FcChar8 *f;
|
1011
|
+
const FcChar8 *slash;
|
1012
|
+
int size;
|
1013
|
+
|
1014
|
+
size = strlen ((char *) s) + 1;
|
1015
|
+
file = malloc (size);
|
1016
|
+
if (!file)
|
1017
|
+
return NULL;
|
1018
|
+
slash = NULL;
|
1019
|
+
f = file;
|
1020
|
+
#ifdef _WIN32
|
1021
|
+
if (*s == '/' && *(s+1) == '/') /* Network path, do not squash // */
|
1022
|
+
*f++ = *s++;
|
1023
|
+
#endif
|
1024
|
+
for (;;) {
|
1025
|
+
if (*s == '/' || *s == '\0')
|
1026
|
+
{
|
1027
|
+
if (slash)
|
1028
|
+
{
|
1029
|
+
switch (s - slash) {
|
1030
|
+
case 1:
|
1031
|
+
f -= 1; /* squash // and trim final / from file */
|
1032
|
+
break;
|
1033
|
+
case 2:
|
1034
|
+
if (!strncmp ((char *) slash, "/.", 2))
|
1035
|
+
{
|
1036
|
+
f -= 2; /* trim /. from file */
|
1037
|
+
}
|
1038
|
+
break;
|
1039
|
+
case 3:
|
1040
|
+
if (!strncmp ((char *) slash, "/..", 3))
|
1041
|
+
{
|
1042
|
+
f -= 3; /* trim /.. from file */
|
1043
|
+
while (f > file) {
|
1044
|
+
if (*--f == '/')
|
1045
|
+
break;
|
1046
|
+
}
|
1047
|
+
}
|
1048
|
+
break;
|
1049
|
+
}
|
1050
|
+
}
|
1051
|
+
slash = s;
|
1052
|
+
}
|
1053
|
+
if (!(*f++ = *s++))
|
1054
|
+
break;
|
1055
|
+
}
|
1056
|
+
return file;
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
#ifdef _WIN32
|
1060
|
+
/*
|
1061
|
+
* Convert '\\' to '/' , remove double '/'
|
1062
|
+
*/
|
1063
|
+
static void
|
1064
|
+
FcConvertDosPath (char *str)
|
1065
|
+
{
|
1066
|
+
size_t len = strlen (str);
|
1067
|
+
char *p = str;
|
1068
|
+
char *dest = str;
|
1069
|
+
char *end = str + len;
|
1070
|
+
char last = 0;
|
1071
|
+
|
1072
|
+
if (*p == '\\')
|
1073
|
+
{
|
1074
|
+
*p = '/';
|
1075
|
+
p++;
|
1076
|
+
dest++;
|
1077
|
+
}
|
1078
|
+
while (p < end)
|
1079
|
+
{
|
1080
|
+
if (*p == '\\')
|
1081
|
+
*p = '/';
|
1082
|
+
|
1083
|
+
if (*p != '/'
|
1084
|
+
|| last != '/')
|
1085
|
+
{
|
1086
|
+
*dest++ = *p;
|
1087
|
+
}
|
1088
|
+
|
1089
|
+
last = *p;
|
1090
|
+
p++;
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
*dest = 0;
|
1094
|
+
}
|
1095
|
+
#endif
|
1096
|
+
|
1097
|
+
FcChar8 *
|
1098
|
+
FcStrCanonFilename (const FcChar8 *s)
|
1099
|
+
{
|
1100
|
+
#ifdef _WIN32
|
1101
|
+
FcChar8 full[FC_MAX_FILE_LEN + 2];
|
1102
|
+
int size = GetFullPathName ((LPCSTR) s, sizeof (full) -1,
|
1103
|
+
(LPSTR) full, NULL);
|
1104
|
+
|
1105
|
+
if (size == 0)
|
1106
|
+
perror ("GetFullPathName");
|
1107
|
+
|
1108
|
+
FcConvertDosPath ((char *) full);
|
1109
|
+
return FcStrCanonAbsoluteFilename (full);
|
1110
|
+
#else
|
1111
|
+
if (s[0] == '/')
|
1112
|
+
return FcStrCanonAbsoluteFilename (s);
|
1113
|
+
else
|
1114
|
+
{
|
1115
|
+
FcChar8 *full;
|
1116
|
+
FcChar8 *file;
|
1117
|
+
|
1118
|
+
FcChar8 cwd[FC_MAX_FILE_LEN + 2];
|
1119
|
+
if (getcwd ((char *) cwd, FC_MAX_FILE_LEN) == NULL)
|
1120
|
+
return NULL;
|
1121
|
+
full = FcStrBuildFilename (cwd, s, NULL);
|
1122
|
+
file = FcStrCanonAbsoluteFilename (full);
|
1123
|
+
FcStrFree (full);
|
1124
|
+
return file;
|
1125
|
+
}
|
1126
|
+
#endif
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
|
1130
|
+
FcStrSet *
|
1131
|
+
FcStrSetCreate (void)
|
1132
|
+
{
|
1133
|
+
return FcStrSetCreateEx (FCSS_DEFAULT);
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
FcStrSet *
|
1137
|
+
FcStrSetCreateEx (unsigned int control)
|
1138
|
+
{
|
1139
|
+
FcStrSet *set = malloc (sizeof (FcStrSet));
|
1140
|
+
if (!set)
|
1141
|
+
return 0;
|
1142
|
+
FcRefInit (&set->ref, 1);
|
1143
|
+
set->num = 0;
|
1144
|
+
set->size = 0;
|
1145
|
+
set->strs = 0;
|
1146
|
+
set->control = control;
|
1147
|
+
return set;
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
static FcBool
|
1151
|
+
_FcStrSetGrow (FcStrSet *set, int growElements)
|
1152
|
+
{
|
1153
|
+
/* accommodate an additional NULL entry at the end of the array */
|
1154
|
+
FcChar8 **strs = malloc ((set->size + growElements + 1) * sizeof (FcChar8 *));
|
1155
|
+
if (!strs)
|
1156
|
+
return FcFalse;
|
1157
|
+
if (set->num)
|
1158
|
+
memcpy (strs, set->strs, set->num * sizeof (FcChar8 *));
|
1159
|
+
if (set->strs)
|
1160
|
+
free (set->strs);
|
1161
|
+
set->size = set->size + growElements;
|
1162
|
+
set->strs = strs;
|
1163
|
+
return FcTrue;
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
static FcBool
|
1167
|
+
_FcStrSetAppend (FcStrSet *set, FcChar8 *s)
|
1168
|
+
{
|
1169
|
+
if (!FcStrSetHasControlBit (set, FCSS_ALLOW_DUPLICATES))
|
1170
|
+
{
|
1171
|
+
if (FcStrSetMember (set, s))
|
1172
|
+
{
|
1173
|
+
FcStrFree (s);
|
1174
|
+
return FcTrue;
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
if (set->num == set->size)
|
1178
|
+
{
|
1179
|
+
int growElements = FcStrSetHasControlBit (set, FCSS_GROW_BY_64) ? 64 : 1;
|
1180
|
+
if (!_FcStrSetGrow(set, growElements))
|
1181
|
+
return FcFalse;
|
1182
|
+
}
|
1183
|
+
set->strs[set->num++] = s;
|
1184
|
+
set->strs[set->num] = 0;
|
1185
|
+
return FcTrue;
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
FcBool
|
1189
|
+
FcStrSetMember (FcStrSet *set, const FcChar8 *s)
|
1190
|
+
{
|
1191
|
+
int i;
|
1192
|
+
|
1193
|
+
for (i = 0; i < set->num; i++)
|
1194
|
+
if (!FcStrCmp (set->strs[i], s))
|
1195
|
+
return FcTrue;
|
1196
|
+
return FcFalse;
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
FcBool
|
1200
|
+
FcStrSetEqual (FcStrSet *sa, FcStrSet *sb)
|
1201
|
+
{
|
1202
|
+
int i;
|
1203
|
+
if (sa->num != sb->num)
|
1204
|
+
return FcFalse;
|
1205
|
+
for (i = 0; i < sa->num; i++)
|
1206
|
+
if (!FcStrSetMember (sb, sa->strs[i]))
|
1207
|
+
return FcFalse;
|
1208
|
+
return FcTrue;
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
FcBool
|
1212
|
+
FcStrSetAdd (FcStrSet *set, const FcChar8 *s)
|
1213
|
+
{
|
1214
|
+
FcChar8 *new = FcStrCopy (s);
|
1215
|
+
if (!new)
|
1216
|
+
return FcFalse;
|
1217
|
+
if (!_FcStrSetAppend (set, new))
|
1218
|
+
{
|
1219
|
+
FcStrFree (new);
|
1220
|
+
return FcFalse;
|
1221
|
+
}
|
1222
|
+
return FcTrue;
|
1223
|
+
}
|
1224
|
+
|
1225
|
+
FcBool
|
1226
|
+
FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s)
|
1227
|
+
{
|
1228
|
+
FcChar8 *new = FcStrCopyFilename (s);
|
1229
|
+
if (!new)
|
1230
|
+
return FcFalse;
|
1231
|
+
if (!_FcStrSetAppend (set, new))
|
1232
|
+
{
|
1233
|
+
FcStrFree (new);
|
1234
|
+
return FcFalse;
|
1235
|
+
}
|
1236
|
+
return FcTrue;
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
FcBool
|
1240
|
+
FcStrSetAddLangs (FcStrSet *strs, const char *languages)
|
1241
|
+
{
|
1242
|
+
const char *p = languages, *next;
|
1243
|
+
FcChar8 lang[128] = {0}, *normalized_lang;
|
1244
|
+
size_t len;
|
1245
|
+
FcBool ret = FcFalse;
|
1246
|
+
|
1247
|
+
if (!languages)
|
1248
|
+
return FcFalse;
|
1249
|
+
|
1250
|
+
while ((next = strchr (p, ':')))
|
1251
|
+
{
|
1252
|
+
len = next - p;
|
1253
|
+
len = FC_MIN (len, 127);
|
1254
|
+
strncpy ((char *) lang, p, len);
|
1255
|
+
lang[len] = 0;
|
1256
|
+
/* ignore an empty item */
|
1257
|
+
if (*lang)
|
1258
|
+
{
|
1259
|
+
normalized_lang = FcLangNormalize ((const FcChar8 *) lang);
|
1260
|
+
if (normalized_lang)
|
1261
|
+
{
|
1262
|
+
FcStrSetAdd (strs, normalized_lang);
|
1263
|
+
FcStrFree (normalized_lang);
|
1264
|
+
ret = FcTrue;
|
1265
|
+
}
|
1266
|
+
}
|
1267
|
+
p = next + 1;
|
1268
|
+
}
|
1269
|
+
if (*p)
|
1270
|
+
{
|
1271
|
+
normalized_lang = FcLangNormalize ((const FcChar8 *) p);
|
1272
|
+
if (normalized_lang)
|
1273
|
+
{
|
1274
|
+
FcStrSetAdd (strs, normalized_lang);
|
1275
|
+
FcStrFree (normalized_lang);
|
1276
|
+
ret = FcTrue;
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
return ret;
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
FcBool
|
1284
|
+
FcStrSetDel (FcStrSet *set, const FcChar8 *s)
|
1285
|
+
{
|
1286
|
+
int i;
|
1287
|
+
|
1288
|
+
for (i = 0; i < set->num; i++)
|
1289
|
+
if (!FcStrCmp (set->strs[i], s))
|
1290
|
+
{
|
1291
|
+
FcStrFree (set->strs[i]);
|
1292
|
+
/*
|
1293
|
+
* copy remaining string pointers and trailing
|
1294
|
+
* NULL
|
1295
|
+
*/
|
1296
|
+
memmove (&set->strs[i], &set->strs[i+1],
|
1297
|
+
(set->num - i) * sizeof (FcChar8 *));
|
1298
|
+
set->num--;
|
1299
|
+
return FcTrue;
|
1300
|
+
}
|
1301
|
+
return FcFalse;
|
1302
|
+
}
|
1303
|
+
|
1304
|
+
/* TODO Make public */
|
1305
|
+
static FcStrSet *
|
1306
|
+
FcStrSetReference (FcStrSet *set)
|
1307
|
+
{
|
1308
|
+
if (FcRefIsConst (&set->ref))
|
1309
|
+
return set;
|
1310
|
+
|
1311
|
+
FcRefInc (&set->ref);
|
1312
|
+
return set;
|
1313
|
+
}
|
1314
|
+
|
1315
|
+
void
|
1316
|
+
FcStrSetDestroy (FcStrSet *set)
|
1317
|
+
{
|
1318
|
+
int i;
|
1319
|
+
|
1320
|
+
/* We rely on this in FcGetDefaultLangs for caching. */
|
1321
|
+
if (FcRefIsConst (&set->ref))
|
1322
|
+
return;
|
1323
|
+
|
1324
|
+
if (FcRefDec (&set->ref) != 1)
|
1325
|
+
return;
|
1326
|
+
|
1327
|
+
for (i = 0; i < set->num; i++)
|
1328
|
+
FcStrFree (set->strs[i]);
|
1329
|
+
if (set->strs)
|
1330
|
+
free (set->strs);
|
1331
|
+
free (set);
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
FcStrList *
|
1335
|
+
FcStrListCreate (FcStrSet *set)
|
1336
|
+
{
|
1337
|
+
FcStrList *list;
|
1338
|
+
|
1339
|
+
list = malloc (sizeof (FcStrList));
|
1340
|
+
if (!list)
|
1341
|
+
return 0;
|
1342
|
+
list->set = set;
|
1343
|
+
FcStrSetReference (set);
|
1344
|
+
list->n = 0;
|
1345
|
+
return list;
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
void
|
1349
|
+
FcStrListFirst (FcStrList *list)
|
1350
|
+
{
|
1351
|
+
list->n = 0;
|
1352
|
+
}
|
1353
|
+
|
1354
|
+
FcChar8 *
|
1355
|
+
FcStrListNext (FcStrList *list)
|
1356
|
+
{
|
1357
|
+
if (list->n >= list->set->num)
|
1358
|
+
return 0;
|
1359
|
+
return list->set->strs[list->n++];
|
1360
|
+
}
|
1361
|
+
|
1362
|
+
void
|
1363
|
+
FcStrListDone (FcStrList *list)
|
1364
|
+
{
|
1365
|
+
FcStrSetDestroy (list->set);
|
1366
|
+
free (list);
|
1367
|
+
}
|
1368
|
+
|
1369
|
+
#define __fcstr__
|
1370
|
+
#include "fcaliastail.h"
|
1371
|
+
#undef __fcstr__
|