mirror of
https://github.com/ToxicFrog/Ligaturizer.git
synced 2024-09-11 09:55:47 +03:00
Merge remote-tracking branch 'gaplo917/master'
This commit is contained in:
commit
258773ce22
31
char_dict.py
Normal file
31
char_dict.py
Normal file
@ -0,0 +1,31 @@
|
||||
char_dict = {
|
||||
'ampersand': '&',
|
||||
'asciicircum': '^',
|
||||
'asciitilde': '~',
|
||||
'asterisk': '*',
|
||||
'backslash': '\\',
|
||||
'bar': '|',
|
||||
'colon': ':',
|
||||
'equal': '=',
|
||||
'exclam': '!',
|
||||
'greater': '>',
|
||||
'hyphen': '-',
|
||||
'less': '<',
|
||||
'numbersign': '#',
|
||||
'percent': '%',
|
||||
'period': '.',
|
||||
'plus': '+',
|
||||
'question': '?',
|
||||
'semicolon': ';',
|
||||
'slash': '/',
|
||||
'underscore': '_',
|
||||
'at': '@',
|
||||
'braceleft': '{',
|
||||
'braceright': '}',
|
||||
'bracketleft': '[',
|
||||
'bracketright': ']',
|
||||
'dollar': '$',
|
||||
'parenleft': '(',
|
||||
'parenright': ')',
|
||||
'w': 'w',
|
||||
}
|
@ -16,6 +16,7 @@ from os import path
|
||||
import sys
|
||||
|
||||
from ligatures import ligatures
|
||||
from char_dict import char_dict
|
||||
|
||||
# Constants
|
||||
COPYRIGHT = '''
|
||||
@ -108,7 +109,7 @@ class LigatureCreator(object):
|
||||
self.font.selection.none()
|
||||
self.font.selection.select(char)
|
||||
self.font.paste()
|
||||
self.correct_character_width(self.font[char])
|
||||
self.correct_character_width(self.font[ord(char_dict[char])])
|
||||
|
||||
def correct_ligature_width(self, glyph):
|
||||
"""Correct the horizontal advance and scale of a ligature."""
|
||||
@ -161,7 +162,7 @@ class LigatureCreator(object):
|
||||
# We assume here that this is because char is a single letter
|
||||
# (e.g. 'w') rather than a character name, and the font we're
|
||||
# editing doesn't have glyphnames for letters.
|
||||
self.font[ord(char)].glyphname = char
|
||||
self.font[ord(char_dict[char])].glyphname = char
|
||||
|
||||
if i < len(input_chars) - 1:
|
||||
self.font.createChar(-1, cr_name(i))
|
||||
|
Loading…
Reference in New Issue
Block a user