Skip to content

Commit

Permalink
Build Windows-capable font by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaveTheRbtz committed Apr 3, 2022
1 parent 9a5261d commit b2216b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# limitations under the License.

EMOJI = NotoColorEmoji
EMOJI_WINDOWS = NotoColorEmoji_WindowsCompatible
all: $(EMOJI).ttf $(EMOJI_WINDOWS).ttf
all: $(EMOJI).ttf

CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
LDFLAGS = -lm `pkg-config --libs cairo`
Expand Down Expand Up @@ -201,9 +200,6 @@ $(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_tools $(COMPRESSED_DIR)
# Run make without -j if this happens.

$(EMOJI).tmpl.ttx: $(EMOJI).tmpl.ttx.tmpl $(ADD_GLYPHS) $(ALL_COMPRESSED_FILES)
$(PYTHON) $(ADD_GLYPHS) -f "$<" -o "$@" -d "$(COMPRESSED_DIR)" $(ADD_GLYPHS_FLAGS)

$(EMOJI_WINDOWS).tmpl.ttx: $(EMOJI).tmpl.ttx.tmpl $(ADD_GLYPHS) $(ALL_COMPRESSED_FILES)
$(PYTHON) $(ADD_GLYPHS) --add_cmap4 --add_glyf -f "$<" -o "$@" -d "$(COMPRESSED_DIR)" $(ADD_GLYPHS_FLAGS)

%.ttf: %.ttx
Expand All @@ -213,15 +209,6 @@ $(EMOJI_WINDOWS).tmpl.ttx: $(EMOJI).tmpl.ttx.tmpl $(ADD_GLYPHS) $(ALL_COMPRESSED
$(EMOJI).ttf: check_sequence $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \
$(ALL_COMPRESSED_FILES) | check_tools

@$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $(word 2,$^) "$@" "$(COMPRESSED_DIR)/emoji_u"
@$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua"
@$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
@mv "$@-with-pua-varsel" "$@"
@rm "$@-with-pua"

$(EMOJI_WINDOWS).ttf: check_sequence $(EMOJI_WINDOWS).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \
$(ALL_COMPRESSED_FILES) | check_tools

@$(PYTHON) $(EMOJI_BUILDER) -O $(SMALL_METRICS) -V $(word 2,$^) "$@" "$(COMPRESSED_DIR)/emoji_u"
@$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua"
@$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
Expand All @@ -237,7 +224,7 @@ else
endif

clean:
rm -f $(EMOJI).ttf $(EMOJI_WINDOWS).ttf $(EMOJI).tmpl.ttf $(EMOJI_WINDOWS).tmpl.ttf $(EMOJI).tmpl.ttx $(EMOJI_WINDOWS).tmpl.ttx
rm -f $(EMOJI).ttf $(EMOJI).tmpl.ttf $(EMOJI).tmpl.ttx
rm -f waveflag
rm -rf $(BUILD_DIR)

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ pip install -r requirements.txt
time make -j
```

Intermediate products (compressed image files, for example) will be put into a build subdirectory. Two fonts will be saved at the top level:
Intermediate products (compressed image files, for example) will be put into a build subdirectory. One font will be saved at the top level:

* `NotoColorEmoji.ttf`, for general use.
* `NotoColorEmoji_WindowsCompatible.ttf`, which is the same font but with an additional empty `glyf` table and `cmap` format 4 subtable. This is required by Windows 10 if you want to _install_ the font.
* `NotoColorEmoji.ttf`, for general use. (Including empty `glyf` table and `cmap` format 4 subtable. This is required by Windows 10 if you want to _install_ the font.)

## Using NotoColorEmoji

Expand Down

0 comments on commit b2216b0

Please sign in to comment.