-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Description
The following codepoints are reserved and should be avoided:
- U+FE00...U+FE0F (65024...65039) are Variation Selectors - see https://codepoints.net/variation_selectors
- U+FE20...U+FE2F (65056...65071) are Combining Half Marks - see https://codepoints.net/combining_half_marks
In my project I have 3380 SVGs icons. I am not explicitly setting codepoints. Codepoints U+F101 (DEFAULT_START_CODEPOINT) ... U+FE3F are automatically allocated by fantasticon. However, these codepoints collide with the reserved codepoints and create rendering issues.
Here's a repro makeicons.sh
script:
#!/bin/bash
# Generate 3380 SVG icons (solid triangle)
mkdir -p icons
((DEFAULT_START_CODEPOINT=16#f101))
for ((i=0;i<3380;i++))
do
echo '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M16 8L24 24 L 8 24z"/></svg>' > $(printf 'icons/icon-%x.svg' $((DEFAULT_START_CODEPOINT+i)))
if ((i % 100 == 0)); then echo "$((i+1)) icons created ..."; fi
done
echo "$i total icons created"
# Generate my-icons.js
cat > my-icons.js <<EOF
module.exports = {
name: 'my-icons',
fontHeight: 500,
normalize: true,
inputDir: './icons',
outputDir: './dist',
fontTypes: ['ttf'],
assetTypes: ['css', 'json', 'html'],
formatOptions: {
json: {
indent: 2
}
},
getIconId: ({
basename,
relativeDirPath,
absoluteFilePath,
relativeFilePath,
index
}) => {
return basename;
}
};
EOF
# Generate my-icons.ttf
mkdir -p dist
fantasticon --config ./my-icons.js
dist/my-icons.html
below shows that icons in U+FE00...U+FE0F are blank and icons in the U+FE20...U+FE2F` are not centered but left jusitifed.
If #527 was implemented, it could help dodge the problematic codepoints.
awa-xima and blutorange
Metadata
Metadata
Assignees
Labels
No labels