Remove blanks facility from the library
XML parser does not accept it anymore either.
This commit is contained in:
parent
3bd4dd27bd
commit
8f4c4d278d
|
@ -21,7 +21,7 @@
|
|||
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
SUBDIRS=fontconfig fc-blanks fc-case fc-lang src \
|
||||
SUBDIRS=fontconfig fc-case fc-lang src \
|
||||
fc-cache fc-cat fc-list fc-match fc-pattern fc-query fc-scan \
|
||||
fc-validate conf.d test
|
||||
if ENABLE_DOCS
|
||||
|
|
|
@ -760,7 +760,6 @@ AC_CONFIG_FILES([
|
|||
Makefile
|
||||
fontconfig/Makefile
|
||||
fc-lang/Makefile
|
||||
fc-blanks/Makefile
|
||||
fc-case/Makefile
|
||||
src/Makefile
|
||||
conf.d/Makefile
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
#
|
||||
# Copyright © 2003 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.
|
||||
|
||||
NULL =
|
||||
BLANKSPY = fc-blanks.py
|
||||
BLANKS_H = fcblanks.h
|
||||
TMPL = fcblanks.tmpl.h
|
||||
noinst_SCRIPTS = $(BLANKSPY)
|
||||
noinst_HEADERS = $(BLANKS_H)
|
||||
|
||||
$(BLANKS_H): $(TMPL) $(BLANKSPY)
|
||||
if HAVE_PYTHON
|
||||
$(AM_V_GEN) $(PYTHON) $(srcdir)/$(BLANKSPY) < $< > $(BLANKS_H).tmp && \
|
||||
mv $(BLANKS_H).tmp $(BLANKS_H) || ($(RM) $(BLANKS_H).tmp && false)
|
||||
else
|
||||
@echo "No python installed. please install python to build $(BLANKS_H)."
|
||||
@false
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(BLANKSPY) \
|
||||
$(BLANKS_H) \
|
||||
$(TMPL) \
|
||||
$(NULL)
|
||||
DISTCLEANFILES = $(BLANKS_H)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
|
@ -1,160 +0,0 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
try:
|
||||
from urllib2 import urlopen
|
||||
from urllib2 import URLError
|
||||
except ImportError:
|
||||
from urllib.request import urlopen
|
||||
from urllib.error import URLError
|
||||
|
||||
import sys
|
||||
import os
|
||||
from lxml import html
|
||||
from six.moves import range
|
||||
|
||||
datafile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'list-unicodeset.html')
|
||||
try:
|
||||
fp = urlopen('http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3AGC%3DZs%3A][%3ADI%3A]&abb=on&ucd=on&esc=on&g')
|
||||
data = fp.read()
|
||||
fp.close()
|
||||
# check before writing if data isn't corrupted.
|
||||
dom = html.fromstring(data)
|
||||
x = dom.xpath('/html/body/form/p/text()')
|
||||
p = x[1]
|
||||
fp = open(datafile, 'wb');
|
||||
fp.write(data);
|
||||
fp.close();
|
||||
except (URLError, IndexError):
|
||||
# fall back reading the static data in repo
|
||||
try:
|
||||
fp = open(datafile)
|
||||
data = fp.read()
|
||||
fp.close()
|
||||
except IOError:
|
||||
sys.stderr.write("Error: No static data to generate the blank data. please make sure the network connection is reachable to Unicode.org\n")
|
||||
sys.exit(1)
|
||||
|
||||
dom = html.fromstring(data)
|
||||
x = dom.xpath('/html/body/form/p/text()')
|
||||
p = x[1]
|
||||
if p[0] == '[' and p[-1] == ']':
|
||||
p = p.replace('[', '').replace(']', '')
|
||||
else:
|
||||
sys.exit(1)
|
||||
fescape = False
|
||||
funicode = False
|
||||
frange = False
|
||||
fprocess = False
|
||||
v = 0
|
||||
vbegin = 0
|
||||
vend = 0
|
||||
n = 0
|
||||
l = []
|
||||
|
||||
def insert(db, begin, end):
|
||||
db.append([begin, end])
|
||||
|
||||
for i in p:
|
||||
if i == '\\':
|
||||
if n > 0:
|
||||
if frange == True and funicode == True:
|
||||
vend = v
|
||||
insert(l, vbegin, vend)
|
||||
fprocess = True
|
||||
elif funicode == True:
|
||||
vbegin = v
|
||||
vend = v
|
||||
insert(l, vbegin, vend)
|
||||
fprocess = True
|
||||
funicode = False
|
||||
fescape = True
|
||||
elif i.lower() == 'u' and fescape == True:
|
||||
funicode = True
|
||||
fescape = False
|
||||
elif i >= '0' and i <= '9' or i.lower() >= 'a' and i.lower() <= 'f':
|
||||
if fescape == True:
|
||||
raise RuntimeError("Unexpected escape code")
|
||||
if funicode == True:
|
||||
v <<= 4
|
||||
v += int(i, 16)
|
||||
else:
|
||||
raise RuntimeError("Unable to parse Unicode")
|
||||
elif i == ' ':
|
||||
if fescape == True:
|
||||
funicode = True
|
||||
fescape = False
|
||||
v = 0x20
|
||||
if frange == True and funicode == True:
|
||||
vend = v
|
||||
insert(l, vbegin, vend)
|
||||
fprocess = True
|
||||
elif funicode == True:
|
||||
vbegin = v
|
||||
vend = v
|
||||
insert(l, vbegin, vend)
|
||||
fprocess = True
|
||||
funicode = False
|
||||
frange = False
|
||||
elif i == '-':
|
||||
if fescape == True:
|
||||
raise RuntimeError("Unexpected escape code")
|
||||
vbegin = v
|
||||
v = 0
|
||||
funicode = False
|
||||
frange = True
|
||||
else:
|
||||
raise RuntimeError("Unable to parse Unicode: %s" % i)
|
||||
|
||||
if fprocess == True:
|
||||
vbegin = 0
|
||||
vend = 0
|
||||
v = 0
|
||||
fprocess = False
|
||||
funicode = False
|
||||
frange = False
|
||||
n += 1
|
||||
|
||||
if frange == True and funicode == True:
|
||||
vend = v
|
||||
insert(l, vbegin, vend)
|
||||
elif funicode == True:
|
||||
vbegin = vend = v
|
||||
insert(l, vbegin, vend)
|
||||
|
||||
ncode = 0
|
||||
for i in l:
|
||||
ncode += (i[1] - i[0] + 1)
|
||||
|
||||
a = int(x[0].split(' ')[0].replace(',', ''))
|
||||
if a != ncode:
|
||||
sys.stderr.write("Unexpected the amount of code points: %d (expected %d)\n" % (ncode, a))
|
||||
sys.exit(1)
|
||||
|
||||
# exception; BRAILLE PATTERN BLANK
|
||||
insert(l, 0x2800, 0x2800)
|
||||
|
||||
while True:
|
||||
s = sys.stdin.readline().rstrip()
|
||||
if s == "@@@":
|
||||
break
|
||||
print(s)
|
||||
|
||||
print("static FcChar32 _fcBlanks[%s] = {" % (ncode + 1))
|
||||
k = 0
|
||||
for i in sorted(l, key=lambda a: a[0]):
|
||||
for j in range(i[0], i[1] + 1):
|
||||
if k != 0:
|
||||
print(",")
|
||||
print(" 0x%04x" % j, end=' ')
|
||||
k += 1
|
||||
|
||||
print("};")
|
||||
print('''
|
||||
static FcBlanks fcBlanks = {
|
||||
%s,
|
||||
-1,
|
||||
_fcBlanks
|
||||
};
|
||||
''' % (ncode + 1))
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* fontconfig/fc-blanks/fcblanks.tmpl.h
|
||||
*
|
||||
* Copyright © 2003 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.
|
||||
*/
|
||||
|
||||
@@@
|
|
@ -1,119 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="en-us">
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
|
||||
<meta name="ProgId" content="FrontPage.Editor.Document">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="index.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<title>Unicode Utilities: UnicodeSet</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Unicode Utilities: UnicodeSet </h1>
|
||||
<p><a target="help" href="http://cldr.unicode.org/unicode-utilities/list-unicodeset"><b>help</b></a> | <a target="character" href="character.jsp">character</a>
|
||||
| <a target="properties" href="properties.jsp">properties</a>
|
||||
| <a target="confusables" href="confusables.jsp">confusables</a>
|
||||
| <a target="list" href="list-unicodeset.jsp">unicode-set</a>
|
||||
| <a target="compare" href="unicodeset.jsp">compare-sets</a>
|
||||
| <a target="regex" href="regex.jsp">regex</a>
|
||||
| <a target="bnf" href="bnf.jsp">bnf-regex</a>
|
||||
| <a target="breaks" href="breaks.jsp">breaks</a>
|
||||
| <a target="transform" href="transform.jsp">transform</a>
|
||||
| <a target="bidi" href="bidi.jsp">bidi</a>
|
||||
| <a target="idna" href="idna.jsp">idna</a>
|
||||
| <a target="languageid" href="languageid.jsp">languageid</a></p>
|
||||
<form name="myform">
|
||||
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width:100%">
|
||||
<tr>
|
||||
<th style="width: 50%">Input</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><textarea name="a" rows="8" cols="10" style="width: 100%">[:GC=Zs:][:DI:]</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id='main' type="submit" value="Show Set" onClick="window.location.href='list-unicodeset.jsp?a='+document.getElementById('main').value"/>
|
||||
<input type="checkbox" checked name="abb"><label for="abb">Abbreviate</label>
|
||||
<input type="checkbox" name="c"><label for="c">Collate</label>
|
||||
<input type="checkbox" checked name="ucd"><label for="ucd">UCD format</label>
|
||||
<input type="checkbox" checked name="esc"><label for="esc">Escape</label>
|
||||
<label for="g">Group by:</label>
|
||||
<input type="text" checked name="g" size="25" value="">
|
||||
<label for="i">Info:</label>
|
||||
<input type="text" checked name="i" size="25" value="">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>4,190 Code Points</p>
|
||||
<hr>
|
||||
<p>[\ \u00A0\u00AD\u034F\u061C\u115F\u1160\u1680\u17B4\u17B5\u180B-\u180E\u2000-\u200F\u202A-\u202F\u205F-\u206F\u3000\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8\U0001BCA0-\U0001BCA3\U0001D173-\U0001D17A\U000E0000-\U000E0FFF]</p>
|
||||
<hr>
|
||||
<table width='100%'><tr><td colSpan='4'><tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=0020'>0020</a></code></td><td>SPACE</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=00A0'>00A0</a></code></td><td>NO-BREAK SPACE</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=00AD'>00AD</a></code></td><td>SOFT HYPHEN</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=034F'>034F</a></code></td><td>COMBINING GRAPHEME JOINER</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=061C'>061C</a></code></td><td>ARABIC LETTER MARK</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=115F'>115F</a></code></td><td>HANGUL CHOSEONG FILLER</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=1160'>1160</a></code></td><td>HANGUL JUNGSEONG FILLER</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=1680'>1680</a></code></td><td>OGHAM SPACE MARK</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=17B4'>17B4</a></code></td><td>KHMER VOWEL INHERENT AQ</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=17B5'>17B5</a></code></td><td>KHMER VOWEL INHERENT AA</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=180B'>180B</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=180E'>180E</a></code></td><td>MONGOLIAN VOWEL SEPARATOR</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=2000'>2000</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=200F'>200F</a></code></td><td>RIGHT-TO-LEFT MARK</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=202A'>202A</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=202F'>202F</a></code></td><td>NARROW NO-BREAK SPACE</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=205F'>205F</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=206F'>206F</a></code></td><td>NOMINAL DIGIT SHAPES</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=3000'>3000</a></code></td><td>IDEOGRAPHIC SPACE</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=3164'>3164</a></code></td><td>HANGUL FILLER</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=FE00'>FE00</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=FE0F'>FE0F</a></code></td><td>VARIATION SELECTOR-16</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=FEFF'>FEFF</a></code></td><td>ZERO WIDTH NO-BREAK SPACE</td></tr>
|
||||
<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=FFA0'>FFA0</a></code></td><td>HALFWIDTH HANGUL FILLER</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=FFF0'>FFF0</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=FFF8'>FFF8</a></code></td><td><i><unassigned-FFF8></i></td></tr>
|
||||
<code><a target='c' href='character.jsp?a=1BCA0'>1BCA0</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=1BCA3'>1BCA3</a></code></td><td>SHORTHAND FORMAT UP STEP</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=1D173'>1D173</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=1D17A'>1D17A</a></code></td><td>MUSICAL SYMBOL END PHRASE</td></tr>
|
||||
<code><a target='c' href='character.jsp?a=E0000'>E0000</a></code>..<tr><td class='charCell' width='3m'> </td><td width='7m'><code><a target='c' href='character.jsp?a=E0FFF'>E0FFF</a></code></td><td><i><unassigned-E0FFF></i></td></tr>
|
||||
</td></tr></table>
|
||||
</form>
|
||||
<hr>
|
||||
<p style="font-size:80%"><b><a name="fonts">Fonts and Display.</a></b> If you don't have a good set of Unicode fonts (and modern browser),
|
||||
you may not be able to read some of the characters.
|
||||
Some suggested fonts that you can add for coverage are:
|
||||
<a href="http://greekfonts.teilar.gr/" target="_blank">Unicode Fonts for Ancient Scripts</a>,
|
||||
<a href="https://www.google.com/get/noto/" target="_blank">Noto Fonts site</a>,
|
||||
<a href="http://www.alanwood.net/unicode/fonts.html" target="_blank">Large, multi-script Unicode fonts</a>.
|
||||
See also: <a href="http://www.unicode.org/help/display_problems.html" target="_blank">Unicode Display Problems</a>.</p>
|
||||
<p style="font-size:80%">Version 3.7;
|
||||
ICU version: 57.0.1.0;
|
||||
Unicode version: 8.0.0.0
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-8314904-1");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}
|
||||
</script>
|
||||
<hr>
|
||||
</body>
|
||||
</html>
|
|
@ -127,7 +127,6 @@ libfontconfig_la_SOURCES = \
|
|||
fcarch.h \
|
||||
fcatomic.c \
|
||||
fcatomic.h \
|
||||
fcblanks.c \
|
||||
fccache.c \
|
||||
fccfg.c \
|
||||
fccharset.c \
|
||||
|
|
108
src/fcblanks.c
108
src/fcblanks.c
|
@ -1,108 +0,0 @@
|
|||
/*
|
||||
* 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->sblank == -1)
|
||||
return;
|
||||
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->sblank == -1)
|
||||
{
|
||||
fprintf (stderr, "Unable to update the static FcBlanks: 0x%04x\n", 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 lower = 0, higher = b->nblank, middle;
|
||||
|
||||
if (b->nblank == 0 ||
|
||||
b->blanks[0] > ucs4 ||
|
||||
b->blanks[b->nblank - 1] < ucs4)
|
||||
return FcFalse;
|
||||
while (1)
|
||||
{
|
||||
middle = (lower + higher) / 2;
|
||||
if (b->blanks[middle] == ucs4)
|
||||
return FcTrue;
|
||||
if (lower >= higher)
|
||||
break;
|
||||
if (b->blanks[middle] < ucs4)
|
||||
lower = middle + 1;
|
||||
else
|
||||
higher = middle - 1;
|
||||
}
|
||||
|
||||
return FcFalse;
|
||||
}
|
||||
#define __fcblanks__
|
||||
#include "fcaliastail.h"
|
||||
#undef __fcblanks__
|
65
src/fccfg.c
65
src/fccfg.c
|
@ -27,7 +27,6 @@
|
|||
#include "fcint.h"
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include "../fc-blanks/fcblanks.h"
|
||||
|
||||
#if defined (_WIN32) && !defined (R_OK)
|
||||
#define R_OK 4
|
||||
|
@ -110,8 +109,6 @@ FcConfigCreate (void)
|
|||
if (!config->cacheDirs)
|
||||
goto bail8;
|
||||
|
||||
config->blanks = &fcBlanks;
|
||||
|
||||
config->substPattern = 0;
|
||||
config->substFont = 0;
|
||||
config->substScan = 0;
|
||||
|
@ -276,9 +273,6 @@ FcConfigDestroy (FcConfig *config)
|
|||
FcFontSetDestroy (config->acceptPatterns);
|
||||
FcFontSetDestroy (config->rejectPatterns);
|
||||
|
||||
if (config->blanks)
|
||||
FcBlanksDestroy (config->blanks);
|
||||
|
||||
FcSubstDestroy (config->substPattern);
|
||||
FcSubstDestroy (config->substFont);
|
||||
FcSubstDestroy (config->substScan);
|
||||
|
@ -569,41 +563,50 @@ FcConfigSetFonts (FcConfig *config,
|
|||
config->fonts[set] = fonts;
|
||||
}
|
||||
|
||||
|
||||
FcBlanks *
|
||||
FcBlanksCreate (void)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
FcBlanksDestroy (FcBlanks *b)
|
||||
{
|
||||
/* Deprecated. */
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcBlanksAdd (FcBlanks *b, FcChar32 ucs4)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)
|
||||
{
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
FcBlanks *
|
||||
FcConfigGetBlanks (FcConfig *config)
|
||||
{
|
||||
if (!config)
|
||||
{
|
||||
config = FcConfigGetCurrent ();
|
||||
if (!config)
|
||||
return 0;
|
||||
}
|
||||
return config->blanks;
|
||||
/* Deprecated. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FcBool
|
||||
FcConfigAddBlank (FcConfig *config,
|
||||
FcChar32 blank)
|
||||
{
|
||||
FcBlanks *b, *freeme = 0;
|
||||
|
||||
b = config->blanks;
|
||||
if (!b)
|
||||
{
|
||||
freeme = b = FcBlanksCreate ();
|
||||
if (!b)
|
||||
return FcFalse;
|
||||
}
|
||||
if (!FcBlanksAdd (b, blank))
|
||||
{
|
||||
if (freeme)
|
||||
FcBlanksDestroy (freeme);
|
||||
return FcFalse;
|
||||
}
|
||||
config->blanks = b;
|
||||
return FcTrue;
|
||||
/* Deprecated. */
|
||||
return FcFalse;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
FcConfigGetRescanInterval (FcConfig *config)
|
||||
{
|
||||
|
@ -2221,7 +2224,7 @@ FcConfigAppFontAddFile (FcConfig *config,
|
|||
FcConfigSetFonts (config, set, FcSetApplication);
|
||||
}
|
||||
|
||||
if (!FcFileScanConfig (set, subdirs, config->blanks, file, config))
|
||||
if (!FcFileScanConfig (set, subdirs, file, config))
|
||||
{
|
||||
FcStrSetDestroy (subdirs);
|
||||
return FcFalse;
|
||||
|
|
28
src/fcdir.c
28
src/fcdir.c
|
@ -64,7 +64,6 @@ FcFileIsFile (const FcChar8 *file)
|
|||
|
||||
static FcBool
|
||||
FcFileScanFontConfig (FcFontSet *set,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcConfig *config)
|
||||
{
|
||||
|
@ -99,7 +98,7 @@ FcFileScanFontConfig (FcFontSet *set,
|
|||
return FcFalse;
|
||||
num_faces = face->num_faces;
|
||||
num_instances = face->style_flags >> 16;
|
||||
font = FcFreeTypeQueryFace (face, file, id, blanks);
|
||||
font = FcFreeTypeQueryFace (face, file, id, NULL);
|
||||
FT_Done_Face (face);
|
||||
|
||||
if (FcDebug () & FC_DBG_SCAN)
|
||||
|
@ -174,7 +173,6 @@ FcFileScanFontConfig (FcFontSet *set,
|
|||
FcBool
|
||||
FcFileScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcConfig *config)
|
||||
{
|
||||
|
@ -201,7 +199,7 @@ FcFileScanConfig (FcFontSet *set,
|
|||
else
|
||||
{
|
||||
if (set)
|
||||
return FcFileScanFontConfig (set, blanks, file, config);
|
||||
return FcFileScanFontConfig (set, file, config);
|
||||
else
|
||||
return FcTrue;
|
||||
}
|
||||
|
@ -211,11 +209,11 @@ FcBool
|
|||
FcFileScan (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcFileCache *cache FC_UNUSED,
|
||||
FcBlanks *blanks,
|
||||
FcBlanks *blanks FC_UNUSED,
|
||||
const FcChar8 *file,
|
||||
FcBool force FC_UNUSED)
|
||||
{
|
||||
return FcFileScanConfig (set, dirs, blanks, file, FcConfigGetCurrent ());
|
||||
return FcFileScanConfig (set, dirs, file, FcConfigGetCurrent ());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -230,7 +228,6 @@ cmpstringp(const void *p1, const void *p2)
|
|||
FcBool
|
||||
FcDirScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *dir,
|
||||
FcBool force, /* XXX unused */
|
||||
FcConfig *config)
|
||||
|
@ -249,9 +246,6 @@ FcDirScanConfig (FcFontSet *set,
|
|||
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) {
|
||||
|
@ -302,7 +296,7 @@ FcDirScanConfig (FcFontSet *set,
|
|||
* Scan file files to build font patterns
|
||||
*/
|
||||
for (i = 0; i < files->num; i++)
|
||||
FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
|
||||
FcFileScanConfig (set, dirs, files->strs[i], config);
|
||||
|
||||
bail2:
|
||||
FcStrSetDestroy (files);
|
||||
|
@ -318,15 +312,15 @@ bail:
|
|||
FcBool
|
||||
FcDirScan (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcFileCache *cache, /* XXX unused */
|
||||
FcBlanks *blanks,
|
||||
FcFileCache *cache FC_UNUSED,
|
||||
FcBlanks *blanks FC_UNUSED,
|
||||
const FcChar8 *dir,
|
||||
FcBool force /* XXX unused */)
|
||||
FcBool force FC_UNUSED)
|
||||
{
|
||||
if (cache || !force)
|
||||
return FcFalse;
|
||||
|
||||
return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent ());
|
||||
return FcDirScanConfig (set, dirs, dir, force, FcConfigGetCurrent ());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -368,7 +362,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
|
|||
/*
|
||||
* Scan the dir
|
||||
*/
|
||||
if (!FcDirScanConfig (set, dirs, NULL, d, FcTrue, config))
|
||||
if (!FcDirScanConfig (set, dirs, d, FcTrue, config))
|
||||
goto bail2;
|
||||
|
||||
/*
|
||||
|
@ -427,7 +421,7 @@ FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
|
|||
/*
|
||||
* Scan the dir
|
||||
*/
|
||||
if (!FcDirScanConfig (NULL, dirs, NULL, d, FcTrue, config))
|
||||
if (!FcDirScanConfig (NULL, dirs, d, FcTrue, config))
|
||||
goto bail1;
|
||||
/*
|
||||
* Rebuild the cache object
|
||||
|
|
15
src/fcint.h
15
src/fcint.h
|
@ -471,12 +471,6 @@ struct _FcAtomic {
|
|||
FcChar8 *tmp; /* tmpfile name (used for locking) */
|
||||
};
|
||||
|
||||
struct _FcBlanks {
|
||||
int nblank;
|
||||
int sblank;
|
||||
FcChar32 *blanks;
|
||||
};
|
||||
|
||||
struct _FcConfig {
|
||||
/*
|
||||
* File names loaded from the configuration -- saved here as the
|
||||
|
@ -484,11 +478,6 @@ struct _FcConfig {
|
|||
* and those directives may occur in any order
|
||||
*/
|
||||
FcStrSet *configDirs; /* directories to scan for fonts */
|
||||
/*
|
||||
* Set of allowed blank chars -- used to
|
||||
* trim fonts of bogus glyphs
|
||||
*/
|
||||
FcBlanks *blanks;
|
||||
/*
|
||||
* List of directories containing fonts,
|
||||
* built by recursively scanning the set
|
||||
|
@ -568,8 +557,6 @@ struct _FcValuePromotionBuffer {
|
|||
} u;
|
||||
};
|
||||
|
||||
/* fcblanks.c */
|
||||
|
||||
/* fccache.c */
|
||||
|
||||
FcPrivate FcCache *
|
||||
|
@ -841,14 +828,12 @@ FcFileIsFile (const FcChar8 *file);
|
|||
FcPrivate FcBool
|
||||
FcFileScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *file,
|
||||
FcConfig *config);
|
||||
|
||||
FcPrivate FcBool
|
||||
FcDirScanConfig (FcFontSet *set,
|
||||
FcStrSet *dirs,
|
||||
FcBlanks *blanks,
|
||||
const FcChar8 *dir,
|
||||
FcBool force,
|
||||
FcConfig *config);
|
||||
|
|
54
src/fcxml.c
54
src/fcxml.c
|
@ -352,7 +352,6 @@ typedef enum _FcElement {
|
|||
FcElementMatch,
|
||||
FcElementAlias,
|
||||
|
||||
FcElementBlank,
|
||||
FcElementRescan,
|
||||
|
||||
FcElementPrefer,
|
||||
|
@ -415,7 +414,6 @@ static const struct {
|
|||
{ "match", FcElementMatch },
|
||||
{ "alias", FcElementAlias },
|
||||
|
||||
{ "blank", FcElementBlank },
|
||||
{ "rescan", FcElementRescan },
|
||||
|
||||
{ "prefer", FcElementPrefer },
|
||||
|
@ -1256,55 +1254,6 @@ FcStartElement(void *userData, const XML_Char *name, const XML_Char **attr)
|
|||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
FcParseBlank (FcConfigParse *parse)
|
||||
{
|
||||
int n = FcVStackElements (parse);
|
||||
#if 0
|
||||
FcChar32 i, begin, end;
|
||||
#endif
|
||||
|
||||
FcConfigMessage (parse, FcSevereWarning, "blank doesn't take any effect anymore. please remove it from your fonts.conf");
|
||||
while (n-- > 0)
|
||||
{
|
||||
FcVStack *v = FcVStackFetch (parse, n);
|
||||
if (!parse->config->blanks)
|
||||
{
|
||||
parse->config->blanks = FcBlanksCreate ();
|
||||
if (!parse->config->blanks)
|
||||
goto bail;
|
||||
}
|
||||
switch ((int) v->tag) {
|
||||
case FcVStackInteger:
|
||||
#if 0
|
||||
if (!FcBlanksAdd (parse->config->blanks, v->u.integer))
|
||||
goto bail;
|
||||
break;
|
||||
#endif
|
||||
case FcVStackRange:
|
||||
#if 0
|
||||
begin = (FcChar32) v->u.range->begin;
|
||||
end = (FcChar32) v->u.range->end;
|
||||
if (begin <= end)
|
||||
{
|
||||
for (i = begin; i <= end; i++)
|
||||
{
|
||||
if (!FcBlanksAdd (parse->config->blanks, i))
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
FcConfigMessage (parse, FcSevereError, "invalid element in blank");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
bail:
|
||||
FcConfigMessage (parse, FcSevereError, "out of memory");
|
||||
}
|
||||
|
||||
static void
|
||||
FcParseRescan (FcConfigParse *parse)
|
||||
{
|
||||
|
@ -2936,9 +2885,6 @@ FcEndElement(void *userData, const XML_Char *name FC_UNUSED)
|
|||
FcParseAlias (parse);
|
||||
break;
|
||||
|
||||
case FcElementBlank:
|
||||
FcParseBlank (parse);
|
||||
break;
|
||||
case FcElementRescan:
|
||||
FcParseRescan (parse);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue