Compare commits
3 Commits
main
...
svg_flags2
Author | SHA1 | Date |
---|---|---|
Cosimo Lupo | 150e8ba1f6 | |
Cosimo Lupo | 08ef0d5c59 | |
Cosimo Lupo | 863d79e517 |
47
BUILD.md
|
@ -1,47 +0,0 @@
|
|||
# Marsey instructions
|
||||
Run the script: ./marsey/marsey_replacer.sh
|
||||
|
||||
Then follow the build instructions for CBDT.
|
||||
|
||||
Despite the instructions stating it would take about 3 minutes, it took about 30 minutes on my computer. Use this snippet to track progress:
|
||||
|
||||
`echo "$(( 100 * $(ls build/compressed_pngs|wc -l) / $(ls build/quantized_pngs |wc -l) ))"'%'`
|
||||
# Build instructions
|
||||
|
||||
---
|
||||
|
||||
Typically build the CBDT then the COLRv1 as COLRv1 copies some information from CBDT.
|
||||
|
||||
## CBDT
|
||||
|
||||
```bash
|
||||
rm -rf venv # in case you have an old borked venv!
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
python size_check.py
|
||||
rm -rf build/ && time make -j 48
|
||||
# Should take 2-3 minutes to create noto-emoji/NotoColorEmoji.ttf
|
||||
|
||||
mv *.ttf fonts/
|
||||
```
|
||||
|
||||
## COLRv1
|
||||
|
||||
```bash
|
||||
# If you are updating to a new Unicode rev, update configs
|
||||
(cd colrv1 && python colrv1_generate_configs.py)
|
||||
git diff colrv1/*.toml
|
||||
|
||||
# Compile the fonts
|
||||
(cd colrv1 && rm -rf build/ && time nanoemoji *.toml)
|
||||
cp colrv1/build/NotoColorEmoji.ttf fonts/Noto-COLRv1.ttf
|
||||
cp colrv1/build/NotoColorEmoji-noflags.ttf fonts/Noto-COLRv1-noflags.ttf
|
||||
|
||||
# Post-process them
|
||||
python colrv1_postproc.py
|
||||
```
|
||||
|
||||
## Emojicompat
|
||||
|
||||
TODO detailed instructions
|
5
Makefile
|
@ -241,11 +241,6 @@ clean:
|
|||
rm -f waveflag
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
# This prints the value of a Makefile variable: e.g. `make print-SELECTED_FLAGS`
|
||||
# will print the content of SELECTED_FLAGS.
|
||||
# Source: https://apprize.best/linux/gnu/3.html
|
||||
print-%: ; @echo $* = $($*)
|
||||
|
||||
.SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \
|
||||
$(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES)
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
<head>
|
||||
<!-- Most of this table will be recalculated by the compiler -->
|
||||
<tableVersion value="1.0"/>
|
||||
<fontRevision value="2.038"/>
|
||||
<fontRevision value="2.034"/>
|
||||
<checkSumAdjustment value="0x4d5a161a"/>
|
||||
<magicNumber value="0x5f0f3cf5"/>
|
||||
<flags value="00000000 00001011"/>
|
||||
|
@ -231,7 +231,7 @@
|
|||
|
||||
<name>
|
||||
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
|
||||
Copyright 2022 Google Inc.
|
||||
Copyright 2013 Google Inc.
|
||||
</namerecord>
|
||||
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
|
||||
Noto Color Emoji
|
||||
|
@ -246,7 +246,7 @@
|
|||
Noto Color Emoji
|
||||
</namerecord>
|
||||
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
|
||||
Version 2.038;GOOG;noto-emoji:20220906:4b1c5bfb0d5b1f5c69aa321d5b6e70656ead1d30
|
||||
Version 2.034;GOOG;noto-emoji:20211013:BETA
|
||||
</namerecord>
|
||||
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
|
||||
NotoColorEmoji
|
||||
|
|
78
README.md
|
@ -1,34 +1,38 @@
|
|||
# Marsey Emoji font for rdrama
|
||||
This is a script for building noto emoji, with some emojis replaced with marseys. All credits for the original noto emoji font goes to google: https://github.com/googlefonts/noto-emoji
|
||||
|
||||
See BUILD.md for building instructions.
|
||||
|
||||
See marsey/README.md for contribution information.
|
||||
|
||||
Download: ![fonts/marseymoji.ttf](fonts/marseymoji.ttf)
|
||||
|
||||
Download (windows compatible): ![fonts/marseymoji_windows.ttf](fonts/marseymoji_windows.ttf)
|
||||
|
||||
|
||||
![](marsey/2023-07-15_21-55.png)
|
||||
|
||||
|
||||
|
||||
![Noto](images/noto.png)
|
||||
# Noto Emoji
|
||||
Noto Emoji (Stands for No Tofu) is an open source (Open Font License 1.1) emoji library that provides standard Unicode emoji support and tools for working with them including:
|
||||
Color and Black-and-White Noto emoji fonts, and tools for working with them.
|
||||
|
||||
- A Unicode compliant color emoji [font](https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf).
|
||||
- A full library of Noto color emoji font files including 3,633 vector svgs and pngs
|
||||
- [Metadata](https://github.com/googlefonts/emoji-metadata) for Emoji Input (including shortcodes, emoji ordering, ascii equivalents)
|
||||
**[Download Emoji Font](https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf)**
|
||||
|
||||
## Color Font
|
||||
## Prerequisites
|
||||
Building Noto Color Emoji requires:
|
||||
- Python 3
|
||||
- [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
|
||||
- [pngquant](https://pngquant.org/)
|
||||
- [zopflipng](https://github.com/google/zopfli)
|
||||
- [cairo](https://www.cairographics.org/)
|
||||
- [imagemagick](https://imagemagick.org/)
|
||||
|
||||
The latest font file is found [here](https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf). If you want to download a specific version, please look at the gh-pages branch, where you will find the built assets for both our latest and older versions.
|
||||
## Building NotoColorEmoji
|
||||
This project uses a virtual environment to manage dependencies. Use the following steps to get up and running:
|
||||
|
||||
## Monochrome Font
|
||||
```shell
|
||||
# make sure you have the Prerequisites
|
||||
|
||||
The black-and-white emoji font is back under active development and is available as a [variable font](https://fonts.google.com/noto/specimen/Noto+Emoji)
|
||||
# create & activate a virtual environment
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
# install python requirements
|
||||
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:
|
||||
|
||||
* `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.
|
||||
|
||||
## Using NotoColorEmoji
|
||||
|
||||
|
@ -37,9 +41,25 @@ and Chrome/Chromium OS. Windows supports it starting with Windows 10 Anniversar
|
|||
Update in Chrome and Edge. On macOS, only Chrome supports it, while on Linux it will
|
||||
support it with some fontconfig tweaking, see [issue #36](https://github.com/googlei18n/noto-emoji/issues/36). Currently we do not build other color font formats.
|
||||
|
||||
## A note about PNGs
|
||||
## Color emoji assets
|
||||
|
||||
The assets provided in the repo are all those used to build the NotoColorEmoji font. With one exception: the flag images in the font are PNG images to which transforms have been applied to standardize the size and generate the wave and border shadow. We do not have SVG versions that reflect these transforms.
|
||||
The assets provided in the repo are all those used to build the NotoColorEmoji
|
||||
font. Note however that NotoColorEmoji often uses the same assets to represent
|
||||
different character sequences-- notably, most gender-neutral characters or
|
||||
sequences are represented using assets named after one of the gendered
|
||||
sequences. This means that some sequences appear to be missing. Definitions of
|
||||
the aliasing used appear in the emoji_aliases.txt file.
|
||||
|
||||
Also note that the images in the font might differ from the original assets. In
|
||||
particular the flag images in the font are PNG images to which transforms have
|
||||
been applied to standardize the size and generate the wave and border shadow. We
|
||||
do not have SVG versions that reflect these transforms.
|
||||
|
||||
## B/W emoji font
|
||||
|
||||
The black-and-white emoji font is not under active development. Its repertoire of
|
||||
emoji is now several years old, and the design does not reflect the current color
|
||||
emoji design. Currently we have no plans to update this font.
|
||||
|
||||
## License
|
||||
|
||||
|
@ -52,3 +72,9 @@ otherwise exempt from copyright ([more info](third_party/region-flags/LICENSE)).
|
|||
## Contributing
|
||||
|
||||
Please read [CONTRIBUTING](CONTRIBUTING.md) if you are thinking of contributing to this project.
|
||||
|
||||
## News
|
||||
|
||||
* 2017-09-13: Emoji redesign released.
|
||||
* 2015-12-09: Unicode 7 and 8 emoji image data (.png format) added.
|
||||
* 2015-09-29: All Noto fonts now licensed under the SIL Open Font License.
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
"""Prints info about emoji fonts."""
|
||||
|
||||
from fontTools import ttLib
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
NAME_ID_VERSION = 5
|
||||
|
||||
|
||||
def name(font, name_id):
|
||||
return ",".join(n.toUnicode() for n in font["name"].names if n.isUnicode() and n.nameID == name_id)
|
||||
|
||||
|
||||
def main():
|
||||
font_files = sorted(p for p in (Path(__file__).parent / "fonts").iterdir() if p.suffix == ".ttf")
|
||||
max_name_len = max(len(p.name) for p in font_files)
|
||||
|
||||
for font_file in font_files:
|
||||
font = ttLib.TTFont(font_file)
|
||||
|
||||
font_type = []
|
||||
if "CBDT" in font:
|
||||
font_type.append("CBDT")
|
||||
if "COLR" in font:
|
||||
font_type.append("COLR")
|
||||
if "meta" in font and "Emji" in font["meta"].data:
|
||||
font_type.append("EmojiCompat")
|
||||
font_type.append(f"fontRevision:{font['head'].fontRevision:.3f}")
|
||||
font_type.append(name(font, NAME_ID_VERSION))
|
||||
font_type = ", ".join(font_type)
|
||||
|
||||
print(f"{font_file.name:{max_name_len + 1}} {font_type}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -140,7 +140,7 @@ def create_simple_gsub(lookups, script='DFLT', feature='ccmp'):
|
|||
|
||||
|
||||
def reg_indicator(letter):
|
||||
"""Return a regional indicator character from corresponding capital letter.
|
||||
"""Return a regional indicator charater from corresponing capital letter.
|
||||
"""
|
||||
return 0x1F1E6 + ord(letter) - ord('A')
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ def _check_valid_emoji_cps(sorted_seq_to_filepath, unicode_version):
|
|||
coverage_pass = False
|
||||
|
||||
if not coverage_pass:
|
||||
exit("Please fix the problems mentioned above or run: make BYPASS_SEQUENCE_CHECK='True'")
|
||||
exit("Please fix the problems metioned above or run: make BYPASS_SEQUENCE_CHECK='True'")
|
||||
|
||||
|
||||
def _check_zwj(sorted_seq_to_filepath):
|
||||
|
@ -144,7 +144,7 @@ def _check_zwj(sorted_seq_to_filepath):
|
|||
pcp = seq[i-1]
|
||||
if pcp != EMOJI_VS and not unicode_data.is_emoji(pcp):
|
||||
print(
|
||||
f'check zwj: non-emoji {pcp} precedes ZWJ in {fp}',
|
||||
f'check zwj: non-emoji {pcp} preceeds ZWJ in {fp}',
|
||||
file=sys.stderr)
|
||||
if i < len(seq) - 1:
|
||||
fcp = seq[i+1]
|
||||
|
@ -313,7 +313,7 @@ def _check_coverage(seq_to_filepath, unicode_version):
|
|||
coverage_pass = False
|
||||
|
||||
if not coverage_pass:
|
||||
exit("Please fix the problems mentioned above or run: make BYPASS_SEQUENCE_CHECK='True'")
|
||||
exit("Please fix the problems metioned above or run: make BYPASS_SEQUENCE_CHECK='True'")
|
||||
|
||||
|
||||
def check_sequence_to_filepath(seq_to_filepath, unicode_version, coverage):
|
||||
|
|
|
@ -98,7 +98,7 @@ def copy_with_rename(src_dir, dst_dir, accept_pred=None, rename=None):
|
|||
def build_svg_dir(dst_dir, clean=False, emoji_dir='', flags_dir=''):
|
||||
"""Copies/renames files from emoji_dir and then flags_dir, giving them the
|
||||
standard format and prefix ('emoji_u' followed by codepoints expressed in hex
|
||||
separated by underscore). If clean, removes the target dir before proceeding.
|
||||
separated by underscore). If clean, removes the target dir before proceding.
|
||||
If either emoji_dir or flags_dir are empty, skips them."""
|
||||
|
||||
dst_dir = tool_utils.ensure_dir_exists(dst_dir, clean=clean)
|
||||
|
|
3736
colrv1/all.toml
3452
colrv1/noflags.toml
|
@ -1,188 +0,0 @@
|
|||
"""Utility to add soft-light effect to NotoColorEmoji-COLRv1 region flags."""
|
||||
import sys
|
||||
import subprocess
|
||||
from fontTools import ttLib
|
||||
from fontTools.ttLib.tables import otTables as ot
|
||||
from fontTools.ttLib.tables.C_P_A_L_ import Color
|
||||
from fontTools.colorLib.builder import LayerListBuilder
|
||||
from add_aliases import read_default_emoji_aliases
|
||||
from flag_glyph_name import flag_code_to_glyph_name
|
||||
from map_pua_emoji import get_glyph_name_from_gsub
|
||||
|
||||
|
||||
REGIONAL_INDICATOR_RANGE = range(0x1F1E6, 0x1F1FF + 1)
|
||||
BLACK_FLAG = 0x1F3F4
|
||||
CANCEL_TAG = 0xE007F
|
||||
TAG_RANGE = range(0xE0000, CANCEL_TAG + 1)
|
||||
|
||||
|
||||
def is_flag(sequence):
|
||||
# regular region flags are comprised of regional indicators
|
||||
if all(cp in REGIONAL_INDICATOR_RANGE for cp in sequence):
|
||||
return True
|
||||
|
||||
# subdivision flags start with black flag, contain some tag characters and end with
|
||||
# a cancel tag
|
||||
if (
|
||||
len(sequence) > 2
|
||||
and sequence[0] == BLACK_FLAG
|
||||
and sequence[-1] == CANCEL_TAG
|
||||
and all(cp in TAG_RANGE for cp in sequence[1:-1])
|
||||
):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def read_makefile_variable(var_name):
|
||||
# see `print-%` command in Makefile
|
||||
value = subprocess.run(
|
||||
["make", f"print-{var_name}"], capture_output=True, check=True
|
||||
).stdout.decode("utf-8")
|
||||
return value[len(var_name) + len(" = ") :].strip()
|
||||
|
||||
|
||||
def flag_code_to_sequence(flag_code):
|
||||
# I use the existing code to first convert from flag code to glyph name,
|
||||
# and then convert names back to integer codepoints since it already
|
||||
# handles both the region indicators and subdivision tags.
|
||||
name = flag_code_to_glyph_name(flag_code)
|
||||
assert name.startswith("u")
|
||||
return tuple(int(v, 16) for v in name[1:].split("_"))
|
||||
|
||||
|
||||
def all_flag_sequences():
|
||||
"""Return the set of all noto-emoji's region and subdivision flag sequences.
|
||||
These include those in SELECTED_FLAGS Makefile variable plus those listed
|
||||
in the 'emoji_aliases.txt' file.
|
||||
"""
|
||||
result = {
|
||||
flag_code_to_sequence(flag_code)
|
||||
for flag_code in read_makefile_variable("SELECTED_FLAGS").split()
|
||||
}
|
||||
result.update(seq for seq in read_default_emoji_aliases() if is_flag(seq))
|
||||
return result
|
||||
|
||||
|
||||
_builder = LayerListBuilder()
|
||||
|
||||
|
||||
def _build_paint(source):
|
||||
return _builder.buildPaint(source)
|
||||
|
||||
|
||||
def _paint_composite(source, mode, backdrop):
|
||||
return _build_paint(
|
||||
{
|
||||
"Format": ot.PaintFormat.PaintComposite,
|
||||
"SourcePaint": source,
|
||||
"CompositeMode": mode,
|
||||
"BackdropPaint": backdrop,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _palette_index(cpal, color):
|
||||
assert len(cpal.palettes) == 1
|
||||
palette = cpal.palettes[0]
|
||||
try:
|
||||
i = palette.index(color)
|
||||
except ValueError:
|
||||
i = len(palette)
|
||||
palette.append(color)
|
||||
cpal.numPaletteEntries += 1
|
||||
assert len(palette) == cpal.numPaletteEntries
|
||||
return i
|
||||
|
||||
|
||||
WHITE = Color.fromHex("#FFFFFFFF")
|
||||
GRAY = Color.fromHex("#808080FF")
|
||||
BLACK = Color.fromHex("#000000FF")
|
||||
|
||||
|
||||
def _soft_light_gradient(cpal):
|
||||
return _build_paint(
|
||||
{
|
||||
"Format": ot.PaintFormat.PaintLinearGradient,
|
||||
"ColorLine": {
|
||||
"Extend": "pad",
|
||||
"ColorStop": [
|
||||
{
|
||||
"StopOffset": 0.0,
|
||||
"PaletteIndex": _palette_index(cpal, WHITE),
|
||||
"Alpha": 0.5,
|
||||
},
|
||||
{
|
||||
"StopOffset": 0.5,
|
||||
"PaletteIndex": _palette_index(cpal, GRAY),
|
||||
"Alpha": 0.5,
|
||||
},
|
||||
{
|
||||
"StopOffset": 1.0,
|
||||
"PaletteIndex": _palette_index(cpal, BLACK),
|
||||
"Alpha": 0.5,
|
||||
},
|
||||
],
|
||||
},
|
||||
"x0": 47,
|
||||
"y0": 790,
|
||||
"x1": 890,
|
||||
"y1": -342,
|
||||
"x2": -1085,
|
||||
"y2": -53,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def flag_ligature_glyphs(font):
|
||||
"""Yield ligature glyph names for all the region/subdivision flags in the font."""
|
||||
for flag_sequence in all_flag_sequences():
|
||||
flag_name = get_glyph_name_from_gsub(flag_sequence, font)
|
||||
if flag_name is not None:
|
||||
yield flag_name
|
||||
|
||||
|
||||
def add_soft_light_to_flags(font, flag_glyph_names=None):
|
||||
"""Add soft-light effect to region and subdivision flags in CORLv1 font."""
|
||||
if flag_glyph_names is None:
|
||||
flag_glyph_names = flag_ligature_glyphs(font)
|
||||
|
||||
colr_glyphs = {
|
||||
rec.BaseGlyph: rec
|
||||
for rec in font["COLR"].table.BaseGlyphList.BaseGlyphPaintRecord
|
||||
}
|
||||
cpal = font["CPAL"]
|
||||
|
||||
for flag_name in flag_glyph_names:
|
||||
flag = colr_glyphs[flag_name]
|
||||
flag.Paint = _paint_composite(
|
||||
source=_paint_composite(
|
||||
source=_soft_light_gradient(cpal),
|
||||
mode=ot.CompositeMode.SRC_IN,
|
||||
backdrop=flag.Paint,
|
||||
),
|
||||
mode=ot.CompositeMode.SOFT_LIGHT,
|
||||
backdrop=flag.Paint,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
input_file, output_file = sys.argv[1:]
|
||||
except ValueError:
|
||||
print("usage: colrv1_add_soft_light_to_flags.py INPUT_FONT OUTPUT_FONT")
|
||||
return 2
|
||||
|
||||
font = ttLib.TTFont(input_file)
|
||||
|
||||
if "COLR" not in font or font["COLR"].version != 1:
|
||||
print("error: missing required COLRv1 table")
|
||||
return 1
|
||||
|
||||
add_soft_light_to_flags(font)
|
||||
|
||||
font.save(output_file)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
|
@ -1,94 +0,0 @@
|
|||
# Copyright 2020 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Generate config files for Noto-COLRv1
|
||||
|
||||
from nanoemoji.util import rel
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
_NOTO_FAMILY_NAME = "Noto Color Emoji"
|
||||
_NOTO_SVG_DIR = Path("svg")
|
||||
_REGIONAL_INDICATORS = {
|
||||
Path(_NOTO_SVG_DIR / f"emoji_u{i:x}.svg") for i in range(0x1F1E6, 0x1F1FF + 1)
|
||||
}
|
||||
_NOTO_WAVED_FLAG_SVG_DIR = Path("third_party/region-flags/waved-svg")
|
||||
_NOTO_SUBDIVISION_FLAGS = (
|
||||
_NOTO_WAVED_FLAG_SVG_DIR / "emoji_u1f3f4_e0067_e0062_e0065_e006e_e0067_e007f.svg",
|
||||
_NOTO_WAVED_FLAG_SVG_DIR / "emoji_u1f3f4_e0067_e0062_e0073_e0063_e0074_e007f.svg",
|
||||
_NOTO_WAVED_FLAG_SVG_DIR / "emoji_u1f3f4_e0067_e0062_e0077_e006c_e0073_e007f.svg",
|
||||
)
|
||||
_CONFIG_DIR = Path("colrv1")
|
||||
|
||||
|
||||
def _write_config(config_name, output_file, svg_files):
|
||||
svg_files = [rel(_CONFIG_DIR, Path(f)) for f in svg_files]
|
||||
config_file = f"{config_name}.toml"
|
||||
for svg_file in svg_files:
|
||||
assert _CONFIG_DIR.joinpath(
|
||||
svg_file
|
||||
).is_file(), f"{svg_file} not found relative to {_CONFIG_DIR}"
|
||||
svg_list = ",\n ".join(f'"{f}"' for f in sorted(svg_files)).rstrip()
|
||||
with open(_CONFIG_DIR / config_file, "w") as f:
|
||||
f.write(
|
||||
f"""
|
||||
family = "{_NOTO_FAMILY_NAME}"
|
||||
output_file = "{output_file}"
|
||||
color_format = "glyf_colr_1"
|
||||
clipbox_quantization = 32
|
||||
|
||||
[axis.wght]
|
||||
name = "Weight"
|
||||
default = 400
|
||||
|
||||
[master.regular]
|
||||
style_name = "Regular"
|
||||
srcs = [
|
||||
{svg_list},
|
||||
]
|
||||
|
||||
[master.regular.position]
|
||||
wght = 400
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def _write_all_noto_configs():
|
||||
# includes all of noto-emoji svgs plus all the waved region flags
|
||||
svgs = tuple(_NOTO_SVG_DIR.glob("*.svg")) + tuple(
|
||||
_NOTO_WAVED_FLAG_SVG_DIR.glob("*.svg")
|
||||
)
|
||||
_write_config("all", "NotoColorEmoji.ttf", svgs)
|
||||
|
||||
|
||||
def _write_noto_noflag_configs():
|
||||
# Does not contain regional indicators and the region flags that are
|
||||
# composed with them. It still includes the England, Scotland and Wales
|
||||
# 'subdivision' flags, as those are not composed with Unicode regional
|
||||
# indicators, but use sequences of Unicode Tag letters prefixed with
|
||||
# the Black Flag and ending with a Cancel Tag.
|
||||
svgs = (
|
||||
tuple(p for p in _NOTO_SVG_DIR.glob("*.svg") if p not in _REGIONAL_INDICATORS)
|
||||
+ _NOTO_SUBDIVISION_FLAGS
|
||||
)
|
||||
_write_config("noflags", "NotoColorEmoji-noflags.ttf", svgs)
|
||||
|
||||
|
||||
def main():
|
||||
_write_all_noto_configs()
|
||||
_write_noto_noflag_configs()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -1,332 +0,0 @@
|
|||
"""
|
||||
Post-nanoemoji processing of the Noto COLRv1 Emoji files.
|
||||
|
||||
Adds additional sequences to properly support Safari, corrects 'name', etc.
|
||||
|
||||
For now substantially based on copying from a correct bitmap build.
|
||||
"""
|
||||
from absl import app
|
||||
import functools
|
||||
from fontTools.feaLib.builder import addOpenTypeFeaturesFromString
|
||||
from fontTools import ttLib
|
||||
from fontTools.ttLib.tables import _g_l_y_f as glyf
|
||||
from fontTools.ttLib.tables import otTables as ot
|
||||
import map_pua_emoji
|
||||
from nototools import add_vs_cmap
|
||||
from nototools import font_data
|
||||
from nototools import unicode_data
|
||||
from pathlib import Path
|
||||
|
||||
from colrv1_add_soft_light_to_flags import add_soft_light_to_flags
|
||||
|
||||
|
||||
_CBDT_FILE = Path("fonts/NotoColorEmoji.ttf")
|
||||
_COLR_FILES = {
|
||||
Path("fonts/Noto-COLRv1-noflags.ttf"),
|
||||
Path("fonts/Noto-COLRv1.ttf"),
|
||||
}
|
||||
|
||||
|
||||
def _is_colrv1(font):
|
||||
return "COLR" in font and font["COLR"].version == 1
|
||||
|
||||
|
||||
def _is_cbdt(font):
|
||||
return "CBDT" in font
|
||||
|
||||
|
||||
def _set_name(name_table, nameID):
|
||||
name_table.getName(value, nameID, 3, 1, 0x409)
|
||||
|
||||
|
||||
def _set_name(name_table, nameID, value):
|
||||
name_table.setName(value, nameID, 3, 1, 0x409)
|
||||
|
||||
|
||||
def _copy_names(colr_font, cbdt_font):
|
||||
colr_font["name"] = cbdt_font["name"]
|
||||
name_table = colr_font["name"]
|
||||
assert all(
|
||||
(n.platformID, n.platEncID, n.langID) == (3, 1, 0x409) for n in name_table.names
|
||||
), "Should only have names Android uses"
|
||||
|
||||
# Amendments
|
||||
_set_name(name_table, 10, "Color emoji font using COLRv1.")
|
||||
_set_name(name_table, 11, "https://github.com/googlefonts/noto-emoji")
|
||||
_set_name(name_table, 12, "https://github.com/googlefonts/noto-emoji")
|
||||
|
||||
|
||||
# CBDT build step: @$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
|
||||
def _add_vs_cmap(colr_font):
|
||||
emoji_variants = unicode_data.get_unicode_emoji_variants() | {
|
||||
0x2640,
|
||||
0x2642,
|
||||
0x2695,
|
||||
}
|
||||
add_vs_cmap.modify_font("COLRv1 Emoji", colr_font, "emoji", emoji_variants)
|
||||
|
||||
|
||||
def _is_variation_selector_cmap_table(table):
|
||||
assert table.format in {4, 12, 14}
|
||||
return table.format == 14
|
||||
|
||||
|
||||
def _lookup_in_cmap(colr_font, codepoint):
|
||||
result = set()
|
||||
for table in colr_font["cmap"].tables:
|
||||
if _is_variation_selector_cmap_table(table):
|
||||
continue
|
||||
assert codepoint in table.cmap
|
||||
result.add(table.cmap[codepoint])
|
||||
assert len(result) == 1, f"Ambiguous mapping for {codepoint}: {result}"
|
||||
return next(iter(result))
|
||||
|
||||
|
||||
def _add_cmap_entries(colr_font, codepoint, glyph_name):
|
||||
for table in colr_font["cmap"].tables:
|
||||
if _is_variation_selector_cmap_table(table):
|
||||
continue
|
||||
if not _is_bmp(codepoint) and table.format == 4:
|
||||
continue
|
||||
table.cmap[codepoint] = glyph_name
|
||||
#print(f"Map 0x{codepoint:04x} to {glyph_name}, format {table.format}")
|
||||
|
||||
|
||||
FLAG_TAGS = set(range(0xE0030, 0xE0039 + 1)) | set(range(0xE0061, 0xE007A + 1))
|
||||
CANCEL_TAG = 0xE007F
|
||||
|
||||
|
||||
def _map_missing_flag_tag_chars_to_empty_glyphs(colr_font):
|
||||
# Add all tag characters used in flags + cancel tag
|
||||
tag_cps = FLAG_TAGS | {CANCEL_TAG}
|
||||
|
||||
# Anything already cmap'd is fine
|
||||
tag_cps -= set(_Cmap(colr_font).keys())
|
||||
|
||||
# CBDT maps these to blank glyphs
|
||||
glyf_table = colr_font["glyf"]
|
||||
hmtx_table = colr_font["hmtx"]
|
||||
glyph_order_size = len(glyf_table.glyphOrder)
|
||||
for cp in tag_cps:
|
||||
#print(f"Map 0x{cp:04x} to a blank glyf")
|
||||
glyph_name = f"u{cp:04X}"
|
||||
assert glyph_name not in glyf_table, f"{glyph_name} already in glyf"
|
||||
assert glyph_name not in hmtx_table.metrics, f"{glyph_name} already in hmtx"
|
||||
glyf_table[glyph_name] = glyf.Glyph()
|
||||
hmtx_table[glyph_name] = (0, 0)
|
||||
|
||||
_add_cmap_entries(colr_font, cp, glyph_name)
|
||||
|
||||
|
||||
def _is_bmp(cp):
|
||||
return cp in range(0x0000, 0xFFFF + 1)
|
||||
|
||||
|
||||
def _ligaset_for_glyph(lookup_list, glyph_name):
|
||||
for lookup in lookup_list.Lookup:
|
||||
if lookup.LookupType != 4:
|
||||
continue
|
||||
for liga_set in lookup.SubTable:
|
||||
if glyph_name in liga_set.ligatures:
|
||||
return liga_set.ligatures[glyph_name]
|
||||
return None
|
||||
|
||||
|
||||
def _Cmap(ttfont):
|
||||
def _Reducer(acc, u):
|
||||
acc.update(u)
|
||||
return acc
|
||||
|
||||
unicode_cmaps = (t.cmap for t in ttfont["cmap"].tables if t.isUnicode())
|
||||
return functools.reduce(_Reducer, unicode_cmaps, {})
|
||||
|
||||
|
||||
def _add_vertical_layout_tables(cbdt_font, colr_font):
|
||||
upem_scale = colr_font["head"].unitsPerEm / cbdt_font["head"].unitsPerEm
|
||||
|
||||
vhea = colr_font["vhea"] = ttLib.newTable("vhea")
|
||||
vhea.tableVersion = 0x00010000
|
||||
vhea.ascent = round(cbdt_font["vhea"].ascent * upem_scale)
|
||||
vhea.descent = round(cbdt_font["vhea"].descent * upem_scale)
|
||||
vhea.lineGap = 0
|
||||
# most of the stuff below is recalculated by the compiler, but still needs to be
|
||||
# initialized... ¯\_(ツ)_/¯
|
||||
vhea.advanceHeightMax = 0
|
||||
vhea.minTopSideBearing = 0
|
||||
vhea.minBottomSideBearing = 0
|
||||
vhea.yMaxExtent = 0
|
||||
vhea.caretSlopeRise = 0
|
||||
vhea.caretSlopeRun = 0
|
||||
vhea.caretOffset = 0
|
||||
vhea.reserved0 = 0
|
||||
vhea.reserved1 = 0
|
||||
vhea.reserved2 = 0
|
||||
vhea.reserved3 = 0
|
||||
vhea.reserved4 = 0
|
||||
vhea.metricDataFormat = 0
|
||||
vhea.numberOfVMetrics = 0
|
||||
|
||||
# emoji font is monospaced -- except for an odd uni0000 (NULL) glyph which happens
|
||||
# to have height=0; but colrv1 font doesn't have that anyway, so I just skip it
|
||||
cbdt_heights = set(h for h, _ in cbdt_font["vmtx"].metrics.values() if h != 0)
|
||||
assert len(cbdt_heights) == 1, "NotoColorEmoji CBDT font should be monospaced!"
|
||||
height = round(cbdt_heights.pop() * upem_scale)
|
||||
vmtx = colr_font["vmtx"] = ttLib.newTable("vmtx")
|
||||
vmtx.metrics = {}
|
||||
for gn in colr_font.getGlyphOrder():
|
||||
vmtx.metrics[gn] = height, 0
|
||||
|
||||
|
||||
UNKNOWN_FLAG_PUA = 0xFE82B
|
||||
BLACK_FLAG = 0x1F3F4
|
||||
REGIONAL_INDICATORS = set(range(0x1F1E6, 0x1F1FF + 1))
|
||||
|
||||
|
||||
def _add_fallback_subs_for_unknown_flags(colr_font):
|
||||
"""Add GSUB lookups to replace unsupported flag sequences with the 'unknown flag'.
|
||||
|
||||
In order to locate the unknown flag, the glyph must be mapped to 0xFE82B PUA code;
|
||||
the latter is removed from the cmap table after the GSUB has been updated.
|
||||
"""
|
||||
cmap = _Cmap(colr_font)
|
||||
unknown_flag = cmap[UNKNOWN_FLAG_PUA]
|
||||
black_flag = cmap[BLACK_FLAG]
|
||||
cancel_tag = cmap[CANCEL_TAG]
|
||||
flag_tags = sorted(cmap[cp] for cp in FLAG_TAGS)
|
||||
# in the *-noflags.ttf font there are no region flags thus this list is empty
|
||||
regional_indicators = sorted(cmap[cp] for cp in REGIONAL_INDICATORS if cp in cmap)
|
||||
|
||||
classes = f'@FLAG_TAGS = [{" ".join(flag_tags)}];\n'
|
||||
if regional_indicators:
|
||||
classes += f"""
|
||||
@REGIONAL_INDICATORS = [{" ".join(regional_indicators)}];
|
||||
@UNKNOWN_FLAG = [{" ".join([unknown_flag] * len(regional_indicators))}];
|
||||
"""
|
||||
lookups = (
|
||||
# the first lookup is a dummy that stands for the emoji sequences ligatures
|
||||
# from the destination font; we only use it to ensure the lookup indices match.
|
||||
# We can't leave it empty otherwise feaLib optimizes it away.
|
||||
f"""
|
||||
lookup placeholder {{
|
||||
sub {unknown_flag} {unknown_flag} by {unknown_flag};
|
||||
}} placeholder;
|
||||
"""
|
||||
+ "\n".join(
|
||||
["lookup delete_glyph {"]
|
||||
+ [f" sub {g} by NULL;" for g in sorted(regional_indicators + flag_tags)]
|
||||
+ ["} delete_glyph;"]
|
||||
)
|
||||
+ (
|
||||
"""
|
||||
lookup replace_with_unknown_flag {
|
||||
sub @REGIONAL_INDICATORS by @UNKNOWN_FLAG;
|
||||
} replace_with_unknown_flag;
|
||||
"""
|
||||
if regional_indicators
|
||||
else "\n"
|
||||
)
|
||||
)
|
||||
features = (
|
||||
"languagesystem DFLT dflt;\n"
|
||||
+ classes
|
||||
+ lookups
|
||||
+ "feature ccmp {"
|
||||
+ f"""
|
||||
lookup placeholder;
|
||||
sub {black_flag} @FLAG_TAGS' lookup delete_glyph;
|
||||
sub {black_flag} {cancel_tag} by {unknown_flag};
|
||||
"""
|
||||
+ (
|
||||
"""
|
||||
sub @REGIONAL_INDICATORS' lookup replace_with_unknown_flag
|
||||
@REGIONAL_INDICATORS' lookup delete_glyph;
|
||||
"""
|
||||
if regional_indicators
|
||||
else ""
|
||||
)
|
||||
+ "} ccmp;"
|
||||
)
|
||||
# feaLib always builds a new GSUB table (can't update one in place) so we have to
|
||||
# use an empty TTFont and then update our GSUB with the newly built lookups
|
||||
temp_font = ttLib.TTFont()
|
||||
temp_font.setGlyphOrder(colr_font.getGlyphOrder())
|
||||
|
||||
addOpenTypeFeaturesFromString(temp_font, features)
|
||||
|
||||
temp_gsub = temp_font["GSUB"].table
|
||||
# sanity check
|
||||
assert len(temp_gsub.FeatureList.FeatureRecord) == 1
|
||||
assert temp_gsub.FeatureList.FeatureRecord[0].FeatureTag == "ccmp"
|
||||
temp_ccmp = temp_gsub.FeatureList.FeatureRecord[0].Feature
|
||||
|
||||
colr_gsub = colr_font["GSUB"].table
|
||||
ccmps = [
|
||||
r.Feature for r in colr_gsub.FeatureList.FeatureRecord if r.FeatureTag == "ccmp"
|
||||
]
|
||||
assert len(ccmps) == 1, f"expected only 1 'ccmp' feature record, found {len(ccmps)}"
|
||||
colr_ccmp = ccmps[0]
|
||||
|
||||
colr_lookups = colr_gsub.LookupList.Lookup
|
||||
assert (
|
||||
len(colr_lookups) == 1
|
||||
), f"expected only 1 lookup in COLRv1's GSUB.LookupList, found {len(colr_lookups)}"
|
||||
assert (
|
||||
colr_lookups[0].LookupType == 4
|
||||
), f"expected Lookup[0] of type 4 in COLRv1, found {colr_lookups[0].LookupType}"
|
||||
|
||||
colr_lookups.extend(temp_gsub.LookupList.Lookup[1:])
|
||||
colr_gsub.LookupList.LookupCount = len(colr_lookups)
|
||||
colr_ccmp.LookupListIndex = temp_ccmp.LookupListIndex
|
||||
colr_ccmp.LookupCount = len(colr_ccmp.LookupListIndex)
|
||||
|
||||
# get rid of the Unknown Flag private codepoint as no longer needed
|
||||
font_data.delete_from_cmap(colr_font, [UNKNOWN_FLAG_PUA])
|
||||
|
||||
|
||||
def _set_no_font_embedding_restrictions(colr_font):
|
||||
# The CBDT/CBLC NotoColorEmoji has OS/2.fsType = 0 (i.e. no embedding restrictions)
|
||||
# so the COLRv1 variant must also have no such restrictions.
|
||||
# https://github.com/notofonts/noto-fonts/issues/2408
|
||||
# https://github.com/google/fonts/issues/5729
|
||||
colr_font["OS/2"].fsType = 0
|
||||
|
||||
|
||||
def _font(path, check_fn, check_fail_str):
|
||||
assert path.is_file(), path
|
||||
font = ttLib.TTFont(path)
|
||||
if not check_fn(font):
|
||||
raise ValueError(path + check_fail_str)
|
||||
return font
|
||||
|
||||
|
||||
def main(_):
|
||||
cbdt_font = _font(_CBDT_FILE, _is_cbdt, " must be a CBDT font")
|
||||
|
||||
for colr_file in _COLR_FILES:
|
||||
colr_font = _font(colr_file, _is_colrv1, " must be a COLRv1 font")
|
||||
|
||||
print(f"Updating {colr_file} from {_CBDT_FILE}")
|
||||
|
||||
_copy_names(colr_font, cbdt_font)
|
||||
|
||||
# CBDT build step: @$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua"
|
||||
map_pua_emoji.add_pua_cmap_to_font(colr_font)
|
||||
|
||||
_add_vs_cmap(colr_font)
|
||||
|
||||
_map_missing_flag_tag_chars_to_empty_glyphs(colr_font)
|
||||
|
||||
add_soft_light_to_flags(colr_font)
|
||||
|
||||
_add_vertical_layout_tables(cbdt_font, colr_font)
|
||||
|
||||
_add_fallback_subs_for_unknown_flags(colr_font)
|
||||
|
||||
_set_no_font_embedding_restrictions(colr_font)
|
||||
|
||||
print("Writing", colr_file)
|
||||
colr_font.save(colr_file)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(main)
|
|
@ -1,48 +0,0 @@
|
|||
"""Removes regional indicators from a font."""
|
||||
|
||||
from fontTools import subset
|
||||
from fontTools import ttLib
|
||||
import functools
|
||||
from pathlib import Path
|
||||
import sys
|
||||
from typing import Set
|
||||
|
||||
|
||||
def codepoints(font: ttLib.TTFont) -> Set[int]:
|
||||
unicode_cmaps = (t.cmap.keys() for t in font['cmap'].tables if t.isUnicode())
|
||||
return functools.reduce(lambda acc, u: acc | u, unicode_cmaps, set())
|
||||
|
||||
|
||||
def is_regional_indicator(cp: int) -> bool:
|
||||
return 0x1F1E6 <= cp <= 0x1F1FF
|
||||
|
||||
|
||||
def main(argv):
|
||||
for font_file in sorted(argv[1:]):
|
||||
font_file = Path(font_file)
|
||||
assert font_file.is_file(), font_file
|
||||
noflags_file = font_file.with_stem(font_file.stem + "-noflags")
|
||||
|
||||
if noflags_file.is_file():
|
||||
print(font_file, "already has", noflags_file, "; nop")
|
||||
continue
|
||||
|
||||
font = ttLib.TTFont(font_file)
|
||||
|
||||
cps = codepoints(font)
|
||||
cps_without_flags = {cp for cp in cps if not is_regional_indicator(cp)}
|
||||
|
||||
if cps == cps_without_flags:
|
||||
print(font_file, "has no regional indicators")
|
||||
continue
|
||||
|
||||
subsetter = subset.Subsetter()
|
||||
subsetter.populate(unicodes=cps_without_flags)
|
||||
subsetter.subset(font)
|
||||
|
||||
font.save(noflags_file)
|
||||
print(font_file, "=>" , noflags_file)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
|
@ -1,36 +0,0 @@
|
|||
"""Set COLRv1 fontRevision from CBDT.
|
||||
|
||||
Used for bugfix, should fix to set properly on build instead.
|
||||
"""
|
||||
|
||||
from fontTools import ttLib
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
|
||||
NAME_ID_VERSION = 5
|
||||
|
||||
|
||||
def name(font, name_id):
|
||||
return ",".join(n.toUnicode() for n in font["name"].names if n.isUnicode() and n.nameID == name_id)
|
||||
|
||||
|
||||
def main():
|
||||
colr_font_files = sorted(p for p in (Path(__file__).parent / "fonts").iterdir() if p.name.startswith("Noto-COLRv1"))
|
||||
|
||||
for colr_font_file in colr_font_files:
|
||||
cbdt_font_file = colr_font_file.with_stem(colr_font_file.stem.replace("Noto-COLRv1", "NotoColorEmoji"))
|
||||
|
||||
colr_font = ttLib.TTFont(colr_font_file)
|
||||
cbdt_font = ttLib.TTFont(cbdt_font_file)
|
||||
|
||||
assert "CBDT" in cbdt_font
|
||||
assert "COLR" in colr_font
|
||||
|
||||
colr_font["head"].fontRevision = cbdt_font["head"].fontRevision
|
||||
|
||||
colr_font.save(colr_font_file)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -29,15 +29,15 @@ at commit a8a215d2e889 and date 20170220 (since dates are a bit easier
|
|||
to locate in time than commit hashes).
|
||||
|
||||
For building with external data we don't include the commit id as we
|
||||
might be using different resources. Instead the version string is:
|
||||
might be using different resoruces. Instead the version string is:
|
||||
Version 1.39;GOOG;noto-emoji:20170518;BETA <msg>
|
||||
|
||||
Here the date is the current date, and the message after 'BETA ' is
|
||||
provided using the '-b' flag. There's no commit hash. This also
|
||||
bypasses some checks about the state of the repo.
|
||||
|
||||
The release number should have 2 or 3 minor digits. Right now we've been
|
||||
using 2 but at the next major release we probably want to use 3. This
|
||||
The relase number should have 2 or 3 minor digits. Right now we've been
|
||||
using 2 but at the next major relase we probably want to use 3. This
|
||||
supports both. It will bump the version number if none is provided,
|
||||
maintaining the minor digit length.
|
||||
"""
|
||||
|
@ -153,7 +153,7 @@ def _replace_existing_version(lines, version, version_str):
|
|||
def update_version(srcfile, dstfile, version, beta):
|
||||
"""Update version in srcfile and write to dstfile. If version is None,
|
||||
bumps the current version, else version must be greater than the
|
||||
current version."""
|
||||
current verison."""
|
||||
|
||||
with open(srcfile, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
|
|
@ -50,7 +50,9 @@ def get_glyph_name_from_gsub(char_seq, font):
|
|||
return None
|
||||
|
||||
|
||||
def add_pua_cmap_to_font(font):
|
||||
def add_pua_cmap(source_file, target_file):
|
||||
"""Add PUA characters to the cmap of the first font and save as second."""
|
||||
font = ttLib.TTFont(source_file)
|
||||
cmap = font_data.get_cmap(font)
|
||||
for pua, (ch1, ch2) in itertools.chain(
|
||||
add_emoji_gsub.EMOJI_KEYCAPS.items(), add_emoji_gsub.EMOJI_FLAGS.items()
|
||||
|
@ -59,12 +61,6 @@ def add_pua_cmap_to_font(font):
|
|||
glyph_name = get_glyph_name_from_gsub([ch1, ch2], font)
|
||||
if glyph_name is not None:
|
||||
cmap[pua] = glyph_name
|
||||
|
||||
|
||||
def add_pua_cmap(source_file, target_file):
|
||||
"""Add PUA characters to the cmap of the first font and save as second."""
|
||||
font = ttLib.TTFont(source_file)
|
||||
add_pua_cmap_to_font(font)
|
||||
font.save(target_file)
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 95 KiB |
|
@ -1,13 +0,0 @@
|
|||
# Marsey font
|
||||
|
||||
marseys/ - all marsey assets
|
||||
|
||||
marseys/marsey_load.sh [name] - download a marsey by its name and automatically convert it to the right format and size. Must be used while inside the marsey directory.
|
||||
|
||||
marseys.conf - links the marseys to the corresponding
|
||||
|
||||
convert_filename.py - convert any emoji to the corresponding emoji identifier for marseys.conf. Eg, 🤓 -> emoji_u1f913.png
|
||||
|
||||
sexrace.py - generates all gender and ethnicity variations given a placeholder input for marseys.conf. Example input for thumbs up: marseythumbsup=emoji_u1f44dRACE.png. Input for cop: marseycop=emoji_u1f46eRACEGENDERADD.png
|
||||
|
||||
marsey_replacer.sh - replaces emojis by marseys, as specified in marseys.conf. Must be run from the marseymoji base directory.
|
|
@ -1,9 +0,0 @@
|
|||
def emoji_to_filename(emoji):
|
||||
code_points = [format(ord(char), 'x') for char in emoji if ord(char) != 0xfe0f]
|
||||
filename = '_'.join(code_points)
|
||||
return 'emoji_u' + filename + '.png'
|
||||
|
||||
emoji = input("copy-paste an emoji: ")
|
||||
filename = emoji_to_filename(emoji)
|
||||
print(filename)
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
REPLACER_RESOLUTION="128"
|
||||
#!/bin/bash
|
||||
|
||||
# Read the marseys.conf file line by line
|
||||
while IFS='=' read -r key value; do
|
||||
# Skip lines starting with #
|
||||
if [[ $key == \#* ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Extract the filenames and paths
|
||||
original_file="png/$REPLACER_RESOLUTION/$value"
|
||||
replacement_file="marsey/marseys/$key.png"
|
||||
|
||||
# Perform the replacement
|
||||
echo "Copying $replacement_file to $original_file ..."
|
||||
cp -f "$replacement_file" "$original_file"
|
||||
done < marsey/marseys.conf
|
||||
|
||||
|
|
@ -1,233 +0,0 @@
|
|||
0=emoji_u0030_20e3.png
|
||||
1=emoji_u0031_20e3.png
|
||||
2=emoji_u0032_20e3.png
|
||||
3=emoji_u0033_20e3.png
|
||||
4=emoji_u0034_20e3.png
|
||||
5=emoji_u0035_20e3.png
|
||||
6=emoji_u0036_20e3.png
|
||||
7=emoji_u0037_20e3.png
|
||||
8=emoji_u0038_20e3.png
|
||||
9=emoji_u0039_20e3.png
|
||||
a=emoji_u1f1e6.png
|
||||
b=emoji_u1f1e7.png
|
||||
c=emoji_u1f1e8.png
|
||||
d=emoji_u1f1e9.png
|
||||
e=emoji_u1f1ea.png
|
||||
f=emoji_u1f1eb.png
|
||||
g=emoji_u1f1ec.png
|
||||
h=emoji_u1f1ed.png
|
||||
i=emoji_u1f1ee.png
|
||||
j=emoji_u1f1ef.png
|
||||
k=emoji_u1f1f0.png
|
||||
l=emoji_u1f1f1.png
|
||||
m=emoji_u1f1f2.png
|
||||
n=emoji_u1f1f3.png
|
||||
o=emoji_u1f1f4.png
|
||||
p=emoji_u1f1f5.png
|
||||
q=emoji_u1f1f6.png
|
||||
r=emoji_u1f1f7.png
|
||||
s=emoji_u1f1f8.png
|
||||
t=emoji_u1f1f9.png
|
||||
u=emoji_u1f1fa.png
|
||||
v=emoji_u1f1fb.png
|
||||
w=emoji_u1f1fc.png
|
||||
x=emoji_u1f1fd.png
|
||||
y=emoji_u1f1fe.png
|
||||
z=emoji_u1f1ff.png
|
||||
marseyblowkiss=emoji_u1f617.png
|
||||
marseyblowkiss=emoji_u1f618.png
|
||||
marseyblush=emoji_u1f633.png
|
||||
marseybuff=emoji_u1f3cb_200d_2642.png
|
||||
marseybuff=emoji_u1f3cb_1f3fb_200d_2642.png
|
||||
marseybuff=emoji_u1f3cb_1f3fc_200d_2642.png
|
||||
marseybuff=emoji_u1f3cb_1f3fd_200d_2642.png
|
||||
marseybuff=emoji_u1f3cb_1f3fe_200d_2642.png
|
||||
marseybuff=emoji_u1f3cb_1f3ff_200d_2642.png
|
||||
gigachadqueen=emoji_u1f3cb_200d_2640.png
|
||||
gigachadqueen=emoji_u1f3cb_1f3fb_200d_2640.png
|
||||
gigachadqueen=emoji_u1f3cb_1f3fc_200d_2640.png
|
||||
gigachadqueen=emoji_u1f3cb_1f3fd_200d_2640.png
|
||||
gigachadqueen=emoji_u1f3cb_1f3fe_200d_2640.png
|
||||
gigachadqueen=emoji_u1f3cb_1f3ff_200d_2640.png
|
||||
marseyburn=emoji_u1f525.png
|
||||
marseycapitalistmanlet=emoji_u1f911.png
|
||||
marseycop=emoji_u1f46e.png
|
||||
marseycop=emoji_u1f46e_1f3fb.png
|
||||
marseycop=emoji_u1f46e_1f3fc.png
|
||||
marseycop=emoji_u1f46e_1f3fd.png
|
||||
marseycop=emoji_u1f46e_1f3fe.png
|
||||
marseycop=emoji_u1f46e_1f3ff.png
|
||||
marseycop=emoji_u1f46e_200d_2640.png
|
||||
marseycop=emoji_u1f46e_1f3fb_200d_2640.png
|
||||
marseycop=emoji_u1f46e_1f3fc_200d_2640.png
|
||||
marseycop=emoji_u1f46e_1f3fd_200d_2640.png
|
||||
marseycop=emoji_u1f46e_1f3fe_200d_2640.png
|
||||
marseycop=emoji_u1f46e_1f3ff_200d_2640.png
|
||||
marseycop=emoji_u1f46e_200d_2642.png
|
||||
marseycop=emoji_u1f46e_1f3fb_200d_2642.png
|
||||
marseycop=emoji_u1f46e_1f3fc_200d_2642.png
|
||||
marseycop=emoji_u1f46e_1f3fd_200d_2642.png
|
||||
marseycop=emoji_u1f46e_1f3fe_200d_2642.png
|
||||
marseycop=emoji_u1f46e_1f3ff_200d_2642.png
|
||||
marseycry=emoji_u1f62d.png
|
||||
marseyfacepalm=emoji_u1f926.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fb.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fc.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fd.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fe.png
|
||||
marseyfacepalm=emoji_u1f926_1f3ff.png
|
||||
marseyfacepalm=emoji_u1f926_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fb_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fc_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fd_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fe_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_1f3ff_200d_2640.png
|
||||
marseyfacepalm=emoji_u1f926_200d_2642.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fb_200d_2642.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fc_200d_2642.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fd_200d_2642.png
|
||||
marseyfacepalm=emoji_u1f926_1f3fe_200d_2642.png
|
||||
marseyfacepalm=emoji_u1f926_1f3ff_200d_2642.png
|
||||
marseyhacker2=emoji_u1f9d1_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f9d1_1f3fb_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f9d1_1f3fc_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f9d1_1f3fd_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f9d1_1f3fe_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f9d1_1f3ff_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_1f3fb_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_1f3fc_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_1f3fd_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_1f3fe_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f469_1f3ff_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_1f3fb_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_1f3fc_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_1f3fd_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_1f3fe_200d_1f4bb.png
|
||||
marseyhacker2=emoji_u1f468_1f3ff_200d_1f4bb.png
|
||||
marseyhearts=emoji_u1f970.png
|
||||
marseyhmm=emoji_u1f914.png
|
||||
marseyill=emoji_u1f912.png
|
||||
marseyvaxmaxx=emoji_u1f637.png
|
||||
marseylaugh=emoji_u1f602.png
|
||||
marseylenny=emoji_u1f60f.png
|
||||
marseylgbtflag4=emoji_u1f3f3_200d_1f308.png
|
||||
marseynerd=emoji_u1f913.png
|
||||
marseypleading2=emoji_u1f97a.png
|
||||
marseythumbsup=emoji_u1f44d.png
|
||||
marseythumbsup=emoji_u1f44d_1f3fb.png
|
||||
marseythumbsup=emoji_u1f44d_1f3fc.png
|
||||
marseythumbsup=emoji_u1f44d_1f3fd.png
|
||||
marseythumbsup=emoji_u1f44d_1f3fe.png
|
||||
marseythumbsup=emoji_u1f44d_1f3ff.png
|
||||
marseytrad=emoji_u1f469.png
|
||||
marseytransflag=emoji_u1f3f3_200d_26a7.png
|
||||
marseywave=emoji_u1f44b.png
|
||||
marseyworried=emoji_u1f61f.png
|
||||
marseyxd=emoji_u1f923.png
|
||||
soyjakanimeglasses=emoji_u1f60e.png
|
||||
soymad=emoji_u1f620.png
|
||||
marseyrage=emoji_u1f621.png
|
||||
marseypepe2=emoji_u1f438.png
|
||||
marseybeansick=emoji_u1f922.png
|
||||
marseypickle=emoji_u1f952.png
|
||||
marseynull=emoji_u1f436.png
|
||||
marseytrans=emoji_u1f415.png
|
||||
marseygoblin=emoji_u1f47a.png
|
||||
marseysleep=emoji_u1f634.png
|
||||
marseywords=emoji_u1f971.png
|
||||
marseydemonicgrin=emoji_u1f479.png
|
||||
marseydisguise=emoji_u1f978.png
|
||||
marseydisgust=emoji_u1f612.png
|
||||
marseysteaming=emoji_u1f624.png
|
||||
marseybeanquestion=emoji_u1f928.png
|
||||
marseybeandrool=emoji_u1f924.png
|
||||
marseybeanimp=emoji_u1f608.png
|
||||
marseybeanmonocle=emoji_u1f9d0.png
|
||||
marseybeanannoyed=emoji_u1f611.png
|
||||
marseybeanrelieved=emoji_u1f60c.png
|
||||
marppy=emoji_u1f916.png
|
||||
marseytroll=emoji_u1f9cc.png
|
||||
marseylove=emoji_u1f60d.png
|
||||
marseyoctopus2=emoji_u1f3a3.png
|
||||
bigsmilesoyjak=emoji_u1f600.png
|
||||
bigsmilesoyjak=emoji_u1f604.png
|
||||
bigsmilesoyjak=emoji_u1f603.png
|
||||
marseystar=emoji_u2b50.png
|
||||
marseysing=emoji_u1f9d1_200d_1f3a4.png
|
||||
marseysing=emoji_u1f9d1_1f3fb_200d_1f3a4.png
|
||||
marseysing=emoji_u1f9d1_1f3fc_200d_1f3a4.png
|
||||
marseysing=emoji_u1f9d1_1f3fd_200d_1f3a4.png
|
||||
marseysing=emoji_u1f9d1_1f3fe_200d_1f3a4.png
|
||||
marseysing=emoji_u1f9d1_1f3ff_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_1f3fb_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_1f3fc_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_1f3fd_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_1f3fe_200d_1f3a4.png
|
||||
marseysing=emoji_u1f469_1f3ff_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_1f3fb_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_1f3fc_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_1f3fd_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_1f3fe_200d_1f3a4.png
|
||||
marseysing=emoji_u1f468_1f3ff_200d_1f3a4.png
|
||||
marseygun=emoji_u1f52b.png
|
||||
marseycloud=emoji_u2601.png
|
||||
marseymayo=emoji_u1f468_1f3fc.png
|
||||
marseyclapping2=emoji_u1f44f.png
|
||||
marseyclapping2=emoji_u1f44f_1f3fb.png
|
||||
marseyclapping2=emoji_u1f44f_1f3fc.png
|
||||
marseyclapping2=emoji_u1f44f_1f3fd.png
|
||||
marseyclapping2=emoji_u1f44f_1f3fe.png
|
||||
marseyclapping2=emoji_u1f44f_1f3ff.png
|
||||
marseylickinglips=emoji_u1f60b.png
|
||||
marseybrofist=emoji_u1f44a.png
|
||||
marseybrofist=emoji_u1f44a_1f3fb.png
|
||||
marseybrofist=emoji_u1f44a_1f3fc.png
|
||||
marseybrofist=emoji_u1f44a_1f3fd.png
|
||||
marseybrofist=emoji_u1f44a_1f3fe.png
|
||||
marseybrofist=emoji_u1f44a_1f3ff.png
|
||||
marseydownvote=emoji_u1f44e.png
|
||||
marseydownvote=emoji_u1f44e_1f3fb.png
|
||||
marseydownvote=emoji_u1f44e_1f3fc.png
|
||||
marseydownvote=emoji_u1f44e_1f3fd.png
|
||||
marseydownvote=emoji_u1f44e_1f3fe.png
|
||||
marseydownvote=emoji_u1f44e_1f3ff.png
|
||||
marseybountyhunter=emoji_u1f920.png
|
||||
marseycheeky=emoji_u1f61b.png
|
||||
marseycheeky=emoji_u1f61c.png
|
||||
marseycheeky=emoji_u1f61d.png
|
||||
marseybattered=emoji_u1f915.png
|
||||
marseywink=emoji_u1f609.png
|
||||
marseyokay=emoji_u1f44c.png
|
||||
marseyokay=emoji_u1f44c_1f3fb.png
|
||||
marseyokay=emoji_u1f44c_1f3fc.png
|
||||
marseyokay=emoji_u1f44c_1f3fd.png
|
||||
marseyokay=emoji_u1f44c_1f3fe.png
|
||||
marseyokay=emoji_u1f44c_1f3ff.png
|
||||
marseysweating=emoji_u1f630.png
|
||||
marseysweating=emoji_u1f605.png
|
||||
marseyangel=emoji_u1f607.png
|
||||
marseyskull=emoji_u1f480.png
|
||||
marseyskull=emoji_u2620.png
|
||||
marseyezramiller=emoji_u1f9d1.png
|
||||
marseyshrug=emoji_u1f937.png
|
||||
marseyshrug=emoji_u1f937_1f3fb.png
|
||||
marseyshrug=emoji_u1f937_1f3fc.png
|
||||
marseyshrug=emoji_u1f937_1f3fd.png
|
||||
marseyshrug=emoji_u1f937_1f3fe.png
|
||||
marseyshrug=emoji_u1f937_1f3ff.png
|
||||
marseyshrug=emoji_u1f937_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_1f3fb_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_1f3fc_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_1f3fd_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_1f3fe_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_1f3ff_200d_2640.png
|
||||
marseyshrug=emoji_u1f937_200d_2642.png
|
||||
marseyshrug=emoji_u1f937_1f3fb_200d_2642.png
|
||||
marseyshrug=emoji_u1f937_1f3fc_200d_2642.png
|
||||
marseyshrug=emoji_u1f937_1f3fd_200d_2642.png
|
||||
marseyshrug=emoji_u1f937_1f3fe_200d_2642.png
|
||||
marseyshrug=emoji_u1f937_1f3ff_200d_2642.png
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 27 KiB |
|
@ -1,2 +0,0 @@
|
|||
#!/bin/bash
|
||||
convert "https://rdrama.net/e/$1.webp[0]" -background none -resize "128x128>" -gravity center -extent 128x128 $1.png
|
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 14 KiB |