diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2017-09-14 22:55:23 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-09-16 07:15:10 +0700 |
commit | 2a8770952b8fdbd0ed7fb3a3d5d4d729c57bc37d (patch) | |
tree | ef86168d4a4addcd8aa8a26b3020a54045767a31 | |
parent | a07824a690e12ffa09001a8eb3621b57730f8494 (diff) | |
download | slackbuilds-2a8770952b8fdbd0ed7fb3a3d5d4d729c57bc37d.tar.gz |
system/noto-emoji: Updated for version git7159f45.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r-- | system/noto-emoji/51-noto-color-emoji.conf.xml | 201 | ||||
-rw-r--r-- | system/noto-emoji/noto-emoji.SlackBuild | 41 | ||||
-rw-r--r-- | system/noto-emoji/noto-emoji.info | 10 | ||||
-rw-r--r-- | system/noto-emoji/patches/293da509043595a052efbead51a9effbbb13794c.patch | 84 | ||||
-rw-r--r-- | system/noto-emoji/patches/c8259f2cb0fe0579e1391811edaf8ed5bb86e220.patch | 162 |
5 files changed, 6 insertions, 492 deletions
diff --git a/system/noto-emoji/51-noto-color-emoji.conf.xml b/system/noto-emoji/51-noto-color-emoji.conf.xml deleted file mode 100644 index 1896c22fa2..0000000000 --- a/system/noto-emoji/51-noto-color-emoji.conf.xml +++ /dev/null @@ -1,201 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> -<!-- /etc/fonts/conf.avail/51-noto-color-emoji.conf --> -<fontconfig> - <selectfont> - <acceptfont> - <pattern> - <patelt name="family"><string>Noto Color Emoji</string></patelt> - </pattern> - </acceptfont> - </selectfont> - - <match target="scan"> - <test name="family"> - <string>Noto Color Emoji</string> - </test> - <edit name="charset"> - <charset> - <int>0xa9</int> - <int>0xae</int> - <int>0x200d</int> - <int>0x203c</int> - <int>0x2049</int> - <int>0x20e3</int> - <int>0x2122</int> - <int>0x2139</int> - <range><int>0x2194</int><int>0x2199</int></range> - <range><int>0x21a9</int><int>0x21aa</int></range> - <range><int>0x231a</int><int>0x231b</int></range> - <int>0x2328</int> - <int>0x23cf</int> - <range><int>0x23e9</int><int>0x23f3</int></range> - <range><int>0x23f8</int><int>0x23fa</int></range> - <int>0x24c2</int> - <range><int>0x25aa</int><int>0x25ab</int></range> - <int>0x25b6</int> - <int>0x25c0</int> - <range><int>0x25fb</int><int>0x25fe</int></range> - <range><int>0x2600</int><int>0x2604</int></range> - <int>0x260e</int> - <int>0x2611</int> - <range><int>0x2614</int><int>0x2615</int></range> - <int>0x2618</int> - <int>0x261d</int> - <int>0x2620</int> - <range><int>0x2622</int><int>0x2623</int></range> - <int>0x2626</int> - <int>0x262a</int> - <range><int>0x262e</int><int>0x262f</int></range> - <range><int>0x2638</int><int>0x263a</int></range> - <int>0x2640</int> - <int>0x2642</int> - <range><int>0x2648</int><int>0x2653</int></range> - <int>0x2660</int> - <int>0x2663</int> - <range><int>0x2665</int><int>0x2666</int></range> - <int>0x2668</int> - <int>0x267b</int> - <int>0x267f</int> - <range><int>0x2692</int><int>0x2697</int></range> - <int>0x2699</int> - <range><int>0x269b</int><int>0x269c</int></range> - <range><int>0x26a0</int><int>0x26a1</int></range> - <range><int>0x26aa</int><int>0x26ab</int></range> - <range><int>0x26b0</int><int>0x26b1</int></range> - <range><int>0x26bd</int><int>0x26be</int></range> - <range><int>0x26c4</int><int>0x26c5</int></range> - <int>0x26c8</int> - <range><int>0x26ce</int><int>0x26cf</int></range> - <int>0x26d1</int> - <range><int>0x26d3</int><int>0x26d4</int></range> - <range><int>0x26e9</int><int>0x26ea</int></range> - <range><int>0x26f0</int><int>0x26f5</int></range> - <range><int>0x26f7</int><int>0x26fa</int></range> - <int>0x26fd</int> - <int>0x2702</int> - <int>0x2705</int> - <range><int>0x2708</int><int>0x270d</int></range> - <int>0x270f</int> - <int>0x2712</int> - <int>0x2714</int> - <int>0x2716</int> - <int>0x271d</int> - <int>0x2721</int> - <int>0x2728</int> - <range><int>0x2733</int><int>0x2734</int></range> - <int>0x2744</int> - <int>0x2747</int> - <int>0x274c</int> - <int>0x274e</int> - <range><int>0x2753</int><int>0x2755</int></range> - <int>0x2757</int> - <range><int>0x2763</int><int>0x2764</int></range> - <range><int>0x2795</int><int>0x2797</int></range> - <int>0x27a1</int> - <int>0x27b0</int> - <int>0x27bf</int> - <range><int>0x2934</int><int>0x2935</int></range> - <range><int>0x2b05</int><int>0x2b07</int></range> - <range><int>0x2b1b</int><int>0x2b1c</int></range> - <int>0x2b50</int> - <int>0x2b55</int> - <int>0x3030</int> - <int>0x303d</int> - <int>0x3297</int> - <int>0x3299</int> - <int>0xfe0f</int> - <int>0x1f004</int> - <int>0x1f0cf</int> - <range><int>0x1f170</int><int>0x1f171</int></range> - <range><int>0x1f17e</int><int>0x1f17f</int></range> - <int>0x1f18e</int> - <range><int>0x1f191</int><int>0x1f19a</int></range> - <range><int>0x1f1e6</int><int>0x1f1ff</int></range> - <range><int>0x1f201</int><int>0x1f202</int></range> - <int>0x1f21a</int> - <int>0x1f22f</int> - <range><int>0x1f232</int><int>0x1f23a</int></range> - <range><int>0x1f250</int><int>0x1f251</int></range> - <range><int>0x1f300</int><int>0x1f321</int></range> - <range><int>0x1f324</int><int>0x1f393</int></range> - <range><int>0x1f396</int><int>0x1f397</int></range> - <range><int>0x1f399</int><int>0x1f39b</int></range> - <range><int>0x1f39e</int><int>0x1f3f0</int></range> - <range><int>0x1f3f3</int><int>0x1f3f5</int></range> - <range><int>0x1f3f7</int><int>0x1f4fd</int></range> - <range><int>0x1f4ff</int><int>0x1f53d</int></range> - <range><int>0x1f549</int><int>0x1f54e</int></range> - <range><int>0x1f550</int><int>0x1f567</int></range> - <range><int>0x1f56f</int><int>0x1f570</int></range> - <range><int>0x1f573</int><int>0x1f57a</int></range> - <int>0x1f587</int> - <range><int>0x1f58a</int><int>0x1f58d</int></range> - <int>0x1f590</int> - <range><int>0x1f595</int><int>0x1f596</int></range> - <range><int>0x1f5a4</int><int>0x1f5a5</int></range> - <int>0x1f5a8</int> - <range><int>0x1f5b1</int><int>0x1f5b2</int></range> - <int>0x1f5bc</int> - <range><int>0x1f5c2</int><int>0x1f5c4</int></range> - <range><int>0x1f5d1</int><int>0x1f5d3</int></range> - <range><int>0x1f5dc</int><int>0x1f5de</int></range> - <int>0x1f5e1</int> - <int>0x1f5e3</int> - <int>0x1f5e8</int> - <int>0x1f5ef</int> - <int>0x1f5f3</int> - <range><int>0x1f5fa</int><int>0x1f64f</int></range> - <range><int>0x1f680</int><int>0x1f6c5</int></range> - <range><int>0x1f6cb</int><int>0x1f6d2</int></range> - <range><int>0x1f6e0</int><int>0x1f6e5</int></range> - <int>0x1f6e9</int> - <range><int>0x1f6eb</int><int>0x1f6ec</int></range> - <int>0x1f6f0</int> - <range><int>0x1f6f3</int><int>0x1f6f6</int></range> - <range><int>0x1f910</int><int>0x1f91e</int></range> - <range><int>0x1f920</int><int>0x1f927</int></range> - <int>0x1f930</int> - <range><int>0x1f933</int><int>0x1f93a</int></range> - <range><int>0x1f93c</int><int>0x1f93e</int></range> - <range><int>0x1f940</int><int>0x1f945</int></range> - <range><int>0x1f947</int><int>0x1f94b</int></range> - <range><int>0x1f950</int><int>0x1f95e</int></range> - <range><int>0x1f980</int><int>0x1f991</int></range> - <int>0x1f9c0</int> - </charset> - </edit> - </match> - - <match target="font"> - <test name="family"> - <string>Noto Color Emoji</string> - </test> - <edit name="scalable" mode="assign"><bool>true</bool></edit> - <edit name="embeddedbitmap" mode="assign"><bool>true</bool></edit> - <edit name="hinting" mode="assign"><bool>true</bool></edit> - <edit name="hintstyle" mode="assign"><const>hintfull</const></edit> - </match> - - <!-- Experimental --> - <match target="pattern"> - <test name="family" qual="first" compare="contains"> - <string>emoji</string> - </test> - <edit mode="assign" name="color"> - <bool>true</bool> - </edit> - <edit mode="assign" name="family"> - <string>Noto Color Emoji</string> - </edit> - </match> - - <match target="pattern"> - <test name="prgname" compare="not_eq"> - <string>java</string> - </test> - <edit name="family" mode="prepend"> - <string>Noto Color Emoji</string> - </edit> - </match> -</fontconfig> diff --git a/system/noto-emoji/noto-emoji.SlackBuild b/system/noto-emoji/noto-emoji.SlackBuild index 949be68d4a..1727d342ec 100644 --- a/system/noto-emoji/noto-emoji.SlackBuild +++ b/system/noto-emoji/noto-emoji.SlackBuild @@ -23,39 +23,18 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=noto-emoji -GITREV=${GITREV:-a4ddd5b44fe2b78643a05ab396d127823db645f7} -NOTOTOOLSGITREV=${NOTOTOOLSGITREV:-feacefe1957dbb2f8bbe874ac9b01d6cd7d29108} +GITREV=${GITREV:-7159f45c5845426e9cc5b923474d8b49796f9255} VERSION=${VERSION:-git$(echo "$GITREV" | sed 's/^\(.\{7\}\).*$/\1/')} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) ARCH=i586 ;; - arm*) ARCH=arm ;; - *) ARCH=$( uname -m ) ;; - esac -fi +ARCH=noarch CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -fi - set -e rm -rf $PKG @@ -64,7 +43,6 @@ cd $TMP rm -rf $PRGNAM-$GITREV tar xvf $CWD/$PRGNAM-$GITREV.tar.gz cd $PRGNAM-$GITREV -tar xvf $CWD/nototools-$NOTOTOOLSGITREV.tar.gz chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -72,23 +50,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -cd nototools-$NOTOTOOLSGITREV -export PATH=$PATH:$(pwd)/nototools -export PYTHONPATH=$(pwd) -cd .. - -# Slackware's Python is a narrow-build - workaround -for sha in c8259f2cb0fe0579e1391811edaf8ed5bb86e220 293da509043595a052efbead51a9effbbb13794c ; do - patch -p1 < $CWD/patches/$sha.patch -done - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -make VERBOSE=true - install -d $PKG/usr/share/fonts/TTF/ install -m644 fonts/*.ttf $PKG/usr/share/fonts/TTF/ -install -m644 *Emoji.ttf $PKG/usr/share/fonts/TTF/ mkdir -p $PKG/etc/fonts/conf.avail/ install -m 0644 $CWD/51-noto-color-emoji.conf.xml $PKG/etc/fonts/conf.avail/51-noto-color-emoji.conf diff --git a/system/noto-emoji/noto-emoji.info b/system/noto-emoji/noto-emoji.info index 9094fecb23..00134e0881 100644 --- a/system/noto-emoji/noto-emoji.info +++ b/system/noto-emoji/noto-emoji.info @@ -1,14 +1,12 @@ PRGNAM="noto-emoji" -VERSION="gita4ddd5b" +VERSION="git7159f45" HOMEPAGE="https://www.google.com/get/noto/help/emoji/" -DOWNLOAD="https://github.com/googlei18n/noto-emoji/archive/a4ddd5b44fe2b78643a05ab396d127823db645f7/noto-emoji-a4ddd5b44fe2b78643a05ab396d127823db645f7.tar.gz \ - https://github.com/googlei18n/nototools/archive/feacefe1957dbb2f8bbe874ac9b01d6cd7d29108/nototools-feacefe1957dbb2f8bbe874ac9b01d6cd7d29108.tar.gz \ +DOWNLOAD="https://github.com/googlei18n/noto-emoji/archive/7159f45c5845426e9cc5b923474d8b49796f9255/noto-emoji-7159f45c5845426e9cc5b923474d8b49796f9255.tar.gz \ https://gist.githubusercontent.com/hexchain/47f550472e79d0805060/raw/d9ecd5a5fcb901bcfb75115f4b602f6c1d3020c1/51-noto-color-emoji.conf.xml" -MD5SUM="22e6d1124b4e4111b70db36ffa1326fc \ - d9d9a166893f76434dd2a0fbbaf6a893 \ +MD5SUM="c8627ccb64f00ac3680f3adb676604d2 \ e2d9cf0460fa0315a8da5d8dedacf702" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="optipng python-fonttools" +REQUIRES="" MAINTAINER="Andrew Clemons" EMAIL="andrew.clemons@gmail.com" diff --git a/system/noto-emoji/patches/293da509043595a052efbead51a9effbbb13794c.patch b/system/noto-emoji/patches/293da509043595a052efbead51a9effbbb13794c.patch deleted file mode 100644 index 5aea67682f..0000000000 --- a/system/noto-emoji/patches/293da509043595a052efbead51a9effbbb13794c.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 293da509043595a052efbead51a9effbbb13794c Mon Sep 17 00:00:00 2001 -From: Andrew Clemons <andrew.clemons@gmail.com> -Date: Thu, 9 Mar 2017 21:48:18 +1300 -Subject: [PATCH] Add support for "narrow" python to emoji_builder.py - -The code currently only works with wide builds since it does not take -UTF-16 surrogate pairs into account. ---- - third_party/color_emoji/emoji_builder.py | 41 ++++++++++++++++++++++++++++---- - 1 file changed, 37 insertions(+), 4 deletions(-) - -diff --git a/third_party/color_emoji/emoji_builder.py b/third_party/color_emoji/emoji_builder.py -index c118e83..3d3e0c8 100644 ---- a/third_party/color_emoji/emoji_builder.py -+++ b/third_party/color_emoji/emoji_builder.py -@@ -25,10 +25,36 @@ - - from nototools import font_data - -+def myunichr(cp): -+ if sys.maxunicode < 0x10FFFF and cp > 0xFFFF: -+ return ("\\U" + hex(cp)[2:].zfill(8)).decode("unicode-escape") -+ return unichr(cp) -+ -+def myord(high, low): -+ return (ord(high) - 0xD800) * 0x400 + (ord(low) - 0xDC00) + 0x10000 -+ -+def begins_with_surrogate(string): -+ return sys.maxunicode < 0x10FFFF and len(string) > 1 and (0xD800 <= ord(string[0]) <= 0xDBFF) and (0xDC00 <= ord(string[1]) <= 0xDFFF) -+ - def get_glyph_name_from_gsub (string, font, cmap_dict): - ligatures = font['GSUB'].table.LookupList.Lookup[0].SubTable[0].ligatures -- first_glyph = cmap_dict[ord (string[0])] -- rest_of_glyphs = [cmap_dict[ord (ch)] for ch in string[1:]] -+ -+ if begins_with_surrogate(string): -+ first_glyph = cmap_dict[myord(string[0], string[1])] -+ string = string[2:] -+ else: -+ first_glyph = cmap_dict[ord (string[0])] -+ string = string[1:] -+ -+ rest_of_glyphs = [] -+ while (len(string) > 0): -+ if begins_with_surrogate(string): -+ rest_of_glyphs.append(cmap_dict[myord(string[0], string[1])]) -+ string = string[2:] -+ else: -+ rest_of_glyphs.append(cmap_dict[ord (string[0])]) -+ string = string[1:] -+ - for ligature in ligatures[first_glyph]: - if ligature.Component == rest_of_glyphs: - return ligature.LigGlyph -@@ -462,13 +488,13 @@ def is_vs(cp): - if "_" in codes: - pieces = codes.split ("_") - cps = [int(code, 16) for code in pieces] -- uchars = "".join ([unichr(cp) for cp in cps if not is_vs(cp)]) -+ uchars = "".join ([myunichr(cp) for cp in cps if not is_vs(cp)]) - else: - cp = int(codes, 16) - if is_vs(cp): - print "ignoring unexpected vs input %04x" % cp - continue -- uchars = unichr(cp) -+ uchars = myunichr(cp) - img_files[uchars] = img_file - if not img_files: - raise Exception ("No image files found in '%s'." % glb) -@@ -483,6 +509,13 @@ def is_vs(cp): - except: - print "no cmap entry for %x" % ord(uchars) - raise ValueError("%x" % ord(uchars)) -+ elif len (uchars) == 2 and begins_with_surrogate(uchars): -+ cp = myord(uchars[0], uchars[1]) -+ try: -+ glyph_name = unicode_cmap.cmap[cp] -+ except: -+ print "no cmap entry for %x" % cp -+ raise ValueError("%x" % ord(uchars)) - else: - glyph_name = get_glyph_name_from_gsub (uchars, font, unicode_cmap.cmap) - glyph_id = font.getGlyphID (glyph_name) diff --git a/system/noto-emoji/patches/c8259f2cb0fe0579e1391811edaf8ed5bb86e220.patch b/system/noto-emoji/patches/c8259f2cb0fe0579e1391811edaf8ed5bb86e220.patch deleted file mode 100644 index e5f4d24764..0000000000 --- a/system/noto-emoji/patches/c8259f2cb0fe0579e1391811edaf8ed5bb86e220.patch +++ /dev/null @@ -1,162 +0,0 @@ -From c8259f2cb0fe0579e1391811edaf8ed5bb86e220 Mon Sep 17 00:00:00 2001 -From: Andrew Clemons <andrew.clemons@gmail.com> -Date: Tue, 7 Mar 2017 18:13:40 +1300 -Subject: [PATCH] Tidy mixed tabs and spaces - ---- - third_party/color_emoji/emoji_builder.py | 76 ++++++++++++++++---------------- - 1 file changed, 37 insertions(+), 39 deletions(-) - -diff --git a/third_party/color_emoji/emoji_builder.py b/third_party/color_emoji/emoji_builder.py -index c847fdb..c118e83 100644 ---- a/third_party/color_emoji/emoji_builder.py -+++ b/third_party/color_emoji/emoji_builder.py -@@ -33,7 +33,6 @@ def get_glyph_name_from_gsub (string, font, cmap_dict): - if ligature.Component == rest_of_glyphs: - return ligature.LigGlyph - -- - def div (a, b): - return int (round (a / float (b))) - -@@ -111,11 +110,11 @@ def write_smallGlyphMetrics (self, width, height): - line_height = (ascent + descent) * y_ppem / float (upem) - line_ascent = ascent * y_ppem / float (upem) - y_bearing = int (round (line_ascent - .5 * (line_height - height))) -- # fudge y_bearing if calculations are a bit off -- if y_bearing == 128: -- y_bearing = 127 -+ # fudge y_bearing if calculations are a bit off -+ if y_bearing == 128: -+ y_bearing = 127 - advance = width -- # print "small glyph metrics h: %d w: %d" % (height, width) -+ # print "small glyph metrics h: %d w: %d" % (height, width) - # smallGlyphMetrics - # Type Name - # BYTE height -@@ -123,14 +122,14 @@ def write_smallGlyphMetrics (self, width, height): - # CHAR BearingX - # CHAR BearingY - # BYTE Advance -- try: -- self.write (struct.pack ("BBbbB", -- height, width, -- x_bearing, y_bearing, -- advance)) -- except Exception as e: -- raise ValueError("%s, h: %d w: %d x: %d y: %d %d a:" % ( -- e, height, width, x_bearing, y_bearing, advance)) -+ try: -+ self.write (struct.pack ("BBbbB", -+ height, width, -+ x_bearing, y_bearing, -+ advance)) -+ except Exception as e: -+ raise ValueError("%s, h: %d w: %d x: %d y: %d %d a:" % ( -+ e, height, width, x_bearing, y_bearing, advance)) - - def write_format1 (self, png): - -@@ -253,11 +252,11 @@ def write_sbitLineMetrics_hori (self): - ascent = div (ascent * y_ppem, upem) - descent = - (line_height - ascent) - self.write (struct.pack ("bbBbbbbbbbbb", -- ascent, descent, -- self.strike_metrics.width, -- 0, 0, 0, -- 0, 0, 0, 0, # TODO -- 0, 0)) -+ ascent, descent, -+ self.strike_metrics.width, -+ 0, 0, 0, -+ 0, 0, 0, 0, # TODO -+ 0, 0)) - - def write_sbitLineMetrics_vert (self): - self.write_sbitLineMetrics_hori () # XXX -@@ -430,10 +429,10 @@ def drop_outline_tables (font): - print "Loaded font '%s'." % font_file - - font_metrics = FontMetrics (font['head'].unitsPerEm, -- font['hhea'].ascent, -- -font['hhea'].descent) -+ font['hhea'].ascent, -+ -font['hhea'].descent) - print "Font metrics: upem=%d ascent=%d descent=%d." % \ -- (font_metrics.upem, font_metrics.ascent, font_metrics.descent) -+ (font_metrics.upem, font_metrics.ascent, font_metrics.descent) - glyph_metrics = font['hmtx'].metrics - unicode_cmap = font['cmap'].getcmap (3, 10) - if not unicode_cmap: -@@ -449,8 +448,8 @@ def drop_outline_tables (font): - eblc.write_header () - eblc.start_strikes (len (img_prefixes)) - -- def is_vs(cp): -- return cp >= 0xfe00 and cp <= 0xfe0f -+ def is_vs(cp): -+ return cp >= 0xfe00 and cp <= 0xfe0f - - for img_prefix in img_prefixes: - print -@@ -462,13 +461,13 @@ def is_vs(cp): - codes = img_file[len (img_prefix):-4] - if "_" in codes: - pieces = codes.split ("_") -- cps = [int(code, 16) for code in pieces] -+ cps = [int(code, 16) for code in pieces] - uchars = "".join ([unichr(cp) for cp in cps if not is_vs(cp)]) - else: -- cp = int(codes, 16) -- if is_vs(cp): -- print "ignoring unexpected vs input %04x" % cp -- continue -+ cp = int(codes, 16) -+ if is_vs(cp): -+ print "ignoring unexpected vs input %04x" % cp -+ continue - uchars = unichr(cp) - img_files[uchars] = img_file - if not img_files: -@@ -479,19 +478,18 @@ def is_vs(cp): - advance = width = height = 0 - for uchars, img_file in img_files.items (): - if len (uchars) == 1: -- try: -- glyph_name = unicode_cmap.cmap[ord (uchars)] -- except: -- print "no cmap entry for %x" % ord(uchars) -- raise ValueError("%x" % ord(uchars)) -+ try: -+ glyph_name = unicode_cmap.cmap[ord (uchars)] -+ except: -+ print "no cmap entry for %x" % ord(uchars) -+ raise ValueError("%x" % ord(uchars)) - else: - glyph_name = get_glyph_name_from_gsub (uchars, font, unicode_cmap.cmap) - glyph_id = font.getGlyphID (glyph_name) - glyph_imgs[glyph_id] = img_file - if "verbose" in options: - uchars_name = ",".join (["%04X" % ord (char) for char in uchars]) -- # print "Matched U+%s: id=%d name=%s image=%s" % ( -- # uchars_name, glyph_id, glyph_name, img_file) -+ # print "Matched U+%s: id=%d name=%s image=%s" % (uchars_name, glyph_id, glyph_name, img_file) - - advance += glyph_metrics[glyph_name][0] - w, h = PNG (img_file).get_size () -@@ -529,10 +527,10 @@ def is_vs(cp): - drop_outline_tables (font) - print "Dropped outline ('glyf', 'CFF ') and related tables." - -- # hack removal of cmap pua entry for unknown flag glyph. If we try to -- # remove it earlier, getGlyphID dies. Need to restructure all of this -- # code. -- font_data.delete_from_cmap(font, [0xfe82b]) -+ # hack removal of cmap pua entry for unknown flag glyph. If we try to -+ # remove it earlier, getGlyphID dies. Need to restructure all of this -+ # code. -+ font_data.delete_from_cmap(font, [0xfe82b]) - - font.save (out_file) - print "Output font '%s' generated." % out_file |