Skip to content

Commit

Permalink
Merge pull request #4 from gaplo917/lock-fira-to-v3.1
Browse files Browse the repository at this point in the history
lock fira code to v3.1 due to #3
  • Loading branch information
gaplo917 committed Jul 15, 2020
2 parents ff1cf94 + 257ad0f commit b448c87
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ before_install:
- sudo apt-get update
- sudo apt-get install -y zip git
- docker build . -t ligatured-hack
- git submodule foreach bash -c 'git fetch --tags; git checkout $(git describe --tags
`git rev-list --tags --max-count=1`);'
# ignore update Fira code submodule due to https://github.com/gaplo917/Ligatured-Hack/issues/3
- git submodule foreach '[ "$path" = "fonts/fira" ] || (git fetch --tags; git checkout $(git describe --tags `git rev-list --tags --max-count=1`));'
script: docker run -v $(pwd)/fonts/output:/usr/src/app/fonts/output ligatured-hack
after_success:
- sh .travis/commit.sh
Expand Down
2 changes: 1 addition & 1 deletion fonts/fira
Submodule fira updated 100 files
2 changes: 1 addition & 1 deletion ligatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def ligature_to_def(ligature):

# 'COPY_CHARACTER_GLYPHS' feature required to prepend the punctuations characters
ligatures = [{'chars': chars, 'ligature_name': None}] \
+ create_ligatures_def(pattern ='fonts/fira/extras/showcases.txt')
+ create_ligatures_def(pattern ='showcases.txt')

print("Definitions:", ligatures)
34 changes: 20 additions & 14 deletions ligaturize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
#
# See ligatures.py for a list of all the ligatures that will be copied.
import sys
from os import path

import fontforge
import psMat
from os import path
from ligatures import ligatures

from char_mapping import char_dict
from ligatures import ligatures


def get_copyright(liga_font_family_name):
Expand Down Expand Up @@ -48,8 +50,10 @@ def copy_ligature_from_source(self, ligature_name):
self.liga_font.selection.none()
self.liga_font.selection.select(ligature_name)
self.liga_font.copy()
# print("Found %s in source font." % ligature_name)
return True
except ValueError:
# print("%s not found in source font." % ligature_name)
return False

def correct_character_width(self, glyph):
Expand Down Expand Up @@ -174,16 +178,18 @@ def cr_name(i):

calt_lookup_name = 'calt.{}'.format(self._lig_counter)
self.font.addLookup(calt_lookup_name, 'gsub_contextchain', (),
(('calt', (('DFLT', ('dflt',)),
('arab', ('dflt',)),
('armn', ('dflt',)),
('cyrl', ('SRB ', 'dflt')),
('geor', ('dflt',)),
('grek', ('dflt',)),
('lao ', ('dflt',)),
('latn', ('CAT ', 'ESP ', 'GAL ', 'ISM ', 'KSM ', 'LSM ', 'MOL ', 'NSM ', 'ROM ', 'SKS ', 'SSM ', 'dflt')),
('math', ('dflt',)),
('thai', ('dflt',)))),))
(('calt', (('DFLT', ('dflt',)),
('arab', ('dflt',)),
('armn', ('dflt',)),
('cyrl', ('SRB ', 'dflt')),
('geor', ('dflt',)),
('grek', ('dflt',)),
('lao ', ('dflt',)),
('latn', (
'CAT ', 'ESP ', 'GAL ', 'ISM ', 'KSM ', 'LSM ', 'MOL ', 'NSM ', 'ROM ', 'SKS ',
'SSM ', 'dflt')),
('math', ('dflt',)),
('thai', ('dflt',)))),))
# print('CALT %s (%s)' % (calt_lookup_name, ligature_name))
for j, char in enumerate(input_chars):
self.add_calt(
Expand All @@ -193,7 +199,7 @@ def cr_name(i):
prev=' '.join(cr_name(j) for j in range(j)),
cur=char,
lookup=lookup_name(j),
next=' '.join(input_chars[j+1:]))
next=' '.join(input_chars[j + 1:]))

# Add ignore rules
self.add_calt(
Expand Down Expand Up @@ -279,7 +285,7 @@ def ligaturize_font(input_font_file, output_dir, ligature_font_file,
def ligature_length(lig):
return len(lig['chars'])

for lig_spec in sorted(ligatures, key = ligature_length):
for lig_spec in sorted(ligatures, key=ligature_length):
try:
creator.add_ligature(lig_spec['chars'], lig_spec['ligature_name'])
except Exception as e:
Expand Down
91 changes: 91 additions & 0 deletions showcases.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.= .- ..= := ::= =:= __
== != === !== =/= =!=

<-< <<- <-- <- <-> -> --> ->> >->
<=< <<= <== <<->> <=> => ==> =>> >=>
>>= >>- >- <~> -< -<< =<<
<-| <=| /\ \/ |-> |=>
<~~ <~ ~~ ~> ~~>

<<< << <= <> >= >> >>>
{. {| [| <: :> |] |} .}
<||| <|| <| <|> |> ||> |||>

<$ <$> $>
<+ <+> +>
<* <*> *>

\n \\ /* */ /// //
</ <!-- </> --> />
0xF www Fl Tl Il fi fj

;; :: ::: !! ?? %% &&
|| .. ... ..< .? ?.
-- --- ++ +++ ** ***

=~ !~ ~- -~ ~@
^= ?= /= /==
-| _|_ |- ||- |= ||=
#! #= ## ### ####
#{ #[ ]# #( #? #_ #_(

# Context-aware alignment

fii fjj
a*b a*A B*b A*B *a *A a* A*
a-b a-A B-b A-B -a -A a- A-
a+b a+A B+b A+B +a +A a+ A+
a:b a:A B:b A:B :a :A a: A:

# Powerline

      

# Stylistic sets

r 0 123456789 & && $ <$ <$> $> @ <= >=

# Unicode

≢ ẞ ᐅ ᐊ ∴ ∵ ⎈ ‖ ∧ ∨ ⊢ ⊣ ⊤ ⊥ ⊦ ⊧ ⊨ ⊩ ⊪ ⊫ ⊬ ⊭ ⊮ ⊯
⟲⟳ ⟰ ⟱ ⟴ ⟵ ⟶ ⟷ ⟸ ⟹ ⟺ ⟻ ⟼ ⟽ ⟾ ⟿
↩ ⇞ ⇟ ⇤ ⇥ ⌀ ⌃ ⌄ ⌅ ⌆ ⌘ ⌤ ⌥ ⎇ ⎋ ⏏ ✓ ☐ ☑ ☒ ▤ ▦ ▧ ▨ ▩
␆ ␈ ␇ ␣ ␢ ␘ ␍ ␐ ␡ ␥ ␔ ␑ ␓ ␒ ␙ ␃ ␄ ␗ ␅ ␛ ␜ ␌ ␝ ␉ ␊ ␕ ␤ ␀ ␞ ␏ ␎ ␠ ␁ ␂ ␚ ␦ ␖ ␟ ␋
ℂ ℍ ℕ ℙ ℚ ℝ ℤ 𝔹 ∀ ∃ ∄ ∅ ⊂ ⊃ ⊄ ⊅ ⊆ ⊇ ⊈ ⊉ ⊊ ⊋ ∈ ∉ ∊ ∋ ∌ ∍ ∪ ∩
☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷ 「a」 「a」

# Box drawing

╭╌╌╌╌╮ ╭┄┄┄┄╮ ╭┈┈┈┈╮
╎ ╏ ┆ ┇ ┊ ┋
╎ ╏ ┆ ┇ ┊ ┋
╰╍╍╍╍╯ ╰┅┅┅┅╯ ╰┉┉┉┉╯

┌─┬─┐ ╔╦═╗ ┏━┳┓ ╒═╤═╗ ╭─┰─╮
├─┼─┤ ╠╬═╣ ┣━╋┫ ├─┼─╢ ┝━╋━┥
└─┴─┘ ╚╩═╝ ┗━┻┛ ╘═╧═╝ ╰─┸─╯

# Blocks

|███ | 50%

▖ ▗ ▙ ▚ ▛ ▜ ▞ ▟

▁▂▃▄▅▆▇█▀▔

# Multi-line brackets

⎛ 1 ⎞ ⎡ a ⎤ ⎧ x ⎫
⎜ 2 ⎟ ⎢ b ⎥ ⎪ y ⎪
⎜ 3 ⎟ ⎢ c ⎥ ⎨ z ⎬
⎜ 4 ⎟ ⎢ d ⎥ ⎪ y ⎪
⎝ 5 ⎠ ⎣ e ⎦ ⎩ x ⎭

0 comments on commit b448c87

Please sign in to comment.