Skip to content

Commit

Permalink
Unicode Version 16.0 update; added sources and build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kenlunde committed Sep 10, 2024
1 parent db9c6a6 commit e890d82
Show file tree
Hide file tree
Showing 384 changed files with 1,374,575 additions and 4 deletions.
7 changes: 7 additions & 0 deletions FontMenuNameDB
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[LastResort-Regular]
f=Last Resort
s=Regular

[LastResortHE-Regular]
f=Last Resort High-Efficiency
s=Regular
372 changes: 372 additions & 0 deletions GlyphOrderAndAliasDB

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Downloading the fonts

The latest pre-built binaries of the *Last Resort* fonts, which correspond to [Unicode Version 15.1.0](https://www.unicode.org/versions/Unicode15.1.0/), can be easily downloaded from the [Latest Release](https://github.com/unicode-org/last-resort-font/releases/latest/). These fonts may be updated for future versions of the Unicode Standard as time and resources permit.
The latest pre-built binaries of the *Last Resort* fonts, which correspond to [Unicode Version 16.0.0](https://www.unicode.org/versions/Unicode16.0.0/), can be easily downloaded from the [Latest Release](https://github.com/unicode-org/last-resort-font/releases/latest/). These fonts may be updated for future versions of the Unicode Standard as time and resources permit.

## Last Resort & Last Resort High-Efficiency

Expand All @@ -23,7 +23,7 @@ Both fonts’ 'cmap' tables include a [Format 4](https://docs.microsoft.com/en-u

## Description

The glyphs of the *Last Resort* fonts are used as the backup of “last resort” to any other font: if a font cannot represent any particular Unicode character, the appropriate “missing” glyph from the *Last Resort* fonts is displayed instead. This provides users with the ability to more easily discern what type of character it is, and provides a clue as to what type of font they would need to display the characters properly. For more information, see *The Unicode Standard*, [Section 5.3](https://www.unicode.org/versions/Unicode15.0.0/ch05.pdf), *Unknown and Missing Characters*.
The glyphs of the *Last Resort* fonts are used as the backup of “last resort” to any other font: if a font cannot represent any particular Unicode character, the appropriate “missing” glyph from the *Last Resort* fonts is displayed instead. This provides users with the ability to more easily discern what type of character it is, and provides a clue as to what type of font they would need to display the characters properly. For more information, see *The Unicode Standard*, [Section 5.3](https://unicode.org/versions/Unicode16.0.0/core-spec/chapter-5/#G7730), *Unknown and Missing Characters*.

Overall, there are a number of advantages to using the *Last Resort* fonts for unrepresentable characters:

Expand All @@ -46,9 +46,9 @@ The *Last Resort* glyphs were drawn by Apple Inc., Michael Everson of [Evertype]

## Building the fonts from source

**NOTE**: *The sources and build scripts may be added after Unicode Version 15.1.0 has been released (2023), and as time and resources permit.*
**NOTE**: *Building the fonts from source requires that [Python Version 3](https://www.python.org/) and [AFDKO](https://github.com/adobe-type-tools/afdko) (Adobe Font Development Kit for OpenType) be installed.*

Updated TrueType fonts may be issued shortly after a new version of the Unicode Standard has been released.
To build the fonts from source, simply execute the `build.sh` file.

## Getting Involved

Expand Down
62 changes: 62 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env sh

# Get the absolute path to the bash script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# Remove old versions
for file in LastResort*-Regular.otf LastResort*-Regular.ttf
do
if [[ -f $file ]]
then
rm $file
echo "Removed $file"
fi
done

# Build FORMAT 13 (Last Resort High-Efficiency; LastResortHE-Regular.ttf)

# Build a temporary name-keyed OpenType/CFF font (OTF)
makeotf -r -nS -nshw -overrideMenuNames -f font.ufo -ff features.fea -omitMacNames -omitDSIG -gf GlyphOrderAndAliasDB -o LastResortHE-Regular.otf

# Convert the OTF to TTF
otf2ttf -o temp.ttf LastResortHE-Regular.otf

# Replace the 'cmap' table with one that includes a Format 13 subtable
ttx -m temp.ttf -o temp2.ttf cmap-f13.ttx

# Replace the 'OS/2' and 'head' tables
ttx -m temp2.ttf -o LastResortHE-Regular.ttf tables.ttx

# Clean up
rm LastResortHE-Regular.otf temp.ttf temp2.ttf

# Build FORMAT 12 (Last Resort; LastResort-Regular.ttf)

# The "lastresort13to12.py" script converts the Format 13 'cmap' subtable
# to a Format 12 subtable, and generates an AFDKO "mergefonts" mapping file
# that creates 16 duplicates of each glyph for more efficient range
# mappings, along with a "GlyphOrderAndAliasDB2" file for use with AFKDO
# "makeotf"

python3 scripts/lastresort13to12.py cmap-f13.ttx
mergefonts font2.ufo mergefonts.map font.ufo
sed -i "" "s/ResortHE/Resort/g ; s/ High-Efficiency//g" font2.ufo/fontinfo.plist
sed "s/ High-Efficiency//g" < features.fea > features2.fea

# Build a temporary name-keyed OpenType/CFF font (OTF)
makeotf -r -nS -nshw -overrideMenuNames -f font2.ufo -ff features2.fea -omitMacNames -omitDSIG -gf GlyphOrderAndAliasDB2 -o LastResort-Regular.otf

# Convert the OTF to TTF
otf2ttf -o temp.ttf LastResort-Regular.otf

# Replace the 'cmap' table with one that includes a Format 12 subtable
ttx -m temp.ttf -o temp2.ttf cmap-f12.ttx

# Replace the 'OS/2' and 'head' tables
ttx -m temp2.ttf -o LastResort-Regular.ttf tables.ttx

# Clean up
rm LastResort-Regular.otf temp.ttf temp2.ttf GlyphOrderAndAliasDB2 cmap-f12.ttx features2.fea mergefonts.map
rm -rf font2.ufo

# EOF
Loading

0 comments on commit e890d82

Please sign in to comment.