Commit graph

227 commits

Author SHA1 Message Date
Fini Jastrow
6be4335a59 name-parser: Create more usable short (Windows) names
[why]
The fontname for Windows can be quite unusable, for example
  `CaskaydiaCoveNerdFontCompleteM-`
for several different fonts, as this is the maximum allowed length of 31
characters that is enforced.

The style/weight is completely lost.

[how]
Split the name into base and style (at a dash `-`) and just shrink the
base name. Result for example:
  `CaskaydiaCoveN-ExtraLightItalic`

Use equal approach for the PostScriptName (although it is less likely
that length limit is ever met).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-22 10:53:05 +02:00
Fini Jastrow
cc099ec965 font-patcher: Finally set fsSelection
fontforge has an undocumented call to set the fsSelection bits.
Never rely on documentation :-(

Found this here:
https://github.com/fontforge/fontforge/issues/3174

And the readback values are actually not read from the source font, so
we do not use them.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-22 10:53:05 +02:00
Fini Jastrow
263b1693c9 font-patcher: Remove WWS names
[why]
Under certain circumstances the WWS names (Family and Subfamily) are
used to identify a font. We do not touch these SFNT table entries, so
when the font is renamed these are wrong (have the original name).
Font-grouping will go wrong then.

[how]
The typographic ('Preferred') Family and Styles are set correctly
already and they follow the WWS pattern, so the WWS fields can be (and
should) be empty. They exist to allow font grouping in the case where
the typographic names do not follow that pattern.

Remove preexisting WWS entries (because they are not needed anymore,
otherwise we would need to write the corrected new names there).

We already set the WWS bit in fsSelection that is needed:
    def fs_selection(self, fs):
        """Modify a given fsSelection value for current name, bits 0, 5, 6, 8, 9 touched"""
        [...]
        b |= WWS # We assert this by our naming process
        return b

Unfortunately we have no way (jet) to set fsSelection.

This is only the case for Iosevka for all fonts in src/unpatched-fonts.

Reported-by: Rui Ming (Max) Xiong <xsrvmy>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-22 10:53:05 +02:00
Fini Jastrow
6d86114a38 Draft: Introduce a file name parser
DO NOT MERGE

[why]
A lot of the fonts have incorrect naming after patching. A completely
different approach can help to come up with a consistent naming scheme.

[how]
See bin/scripts/name-parser/README.md

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-22 10:53:05 +02:00
Fini Jastrow
953ec87918 patch-em-all: Fix purging for font names that have blanks
[why]
The detection if all fonts of a given directory are to be processed is
broken if the font files contain blanks
(like 'Symbols-1000-em Nerd Font Complete Mono Windows Compatible.ttf')

[how]
Need to put name argument in quotes...
Also fix counting for sfd files (but we never generate them anyhow)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-20 19:33:29 +02:00
Fini Jastrow
821ac68173 Create symbols only font directly from sfd template
[why]
The symbol only fonts Symbols-1000-em Nerd Font Complete.ttf
and 2048-em in `NerdFontsSymbolsOnly/` are generated from
some 'almost' empty source fonts, that are assumable in turn generated
from the sfd font descriptions in `src/glyphs/`?

The process is not documented and we have issues in the generated font
(for example the glyph for capital `E` is defined (and empty) #581 #765).

[how]
Use the existing font definitions from `src/glyphs/*.sfd` directly as
source font. That needs a change in font-patcher because the empty
fonts have no glyphs that can be used to orient the scaling upon. In
that case scale on the source font definitions EM.

Then we need patch-em-all to also patch *.sfd fonts.

And finally we need patch-em-all to take a font specific command line
switch for font-patcher (compare 9e2bc9a26 of #723) to instruct it to
create a ttf rather than a sfd font file.

In the sfd file we additionally set the Panose type.
And the UnderlinePosition is adjusted to match the current patched font.

[note]
Also fix wrong glob pattern in patch-em-all `*.[o,t]tf`. The comma is
for sure some leftover from a '{}' shell pattern, that is not used
anymore. (This comment is probably outdated, due to rebasing.)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-20 19:33:29 +02:00
Fini Jastrow
5ceb1b2395 patch-em-all: Allow to specify font specific options
[why]
We want to patch some fonts with different font-patcher options.

[how]
Use the config.cfg file that each source font can have to specify one
arbitrary option to the font-patcher calls.

[note]
This is partially commit 9e2bc9a26 from #723.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-20 19:33:29 +02:00
Fini Jastrow
89907120d9 CI: Add Lilex to release
[why]
Lilex is missing from the 2.2.0 RC and is not automagically patched.

[how]
Add Lilex to the font metadata database :->

[note]
Lilex's licence has no RFN given.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-20 18:28:04 +02:00
Fini Jastrow
47b0c083d5 gotta-patch-em-all: Fix filename parsing (part 2)
[why]
The new 'pathname' pattern always added a '*' glob to the end.

So when we wanted to (just) recreate "Inconsolata" (by specifying
"/Inconsolata") that means "/Inconsolata*/*.[to]tf".

But that includes also "IncolsolataGo" and "InconsolataLCG" :-(

[how]
Just remove the globbing after the pathname. If a pathname is specified
it must be the correct pathname and no star is added per default.

Users could still specify "/Incon*" to get all Inconsolatas in the
pathname based filter mode.
2022-08-19 13:24:39 +02:00
Fini Jastrow
5ff4f92a23 CI: Use fontforge March 2022 AppImage
[why]
It might be easier to use the precompiled application than to build it
ourselves.

[how]
The AppImage has the typical problem with relative paths, so we need to
change some small calls.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-19 13:24:39 +02:00
Fini Jastrow
e957f9f217 gotta-patch-em-all: Fix filename parsing
[why]
The find predicate (e.g. -iname) and predicate parameter (the actual
pattern) are in one variable and will be handed over to find as one
parameter instead of two.

How could this ever work?

[how]
Pass predicate mode and predicate parameter as two shell variables.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 12:20:06 +02:00
Fini Jastrow
afd7ba1017 patch-em-all: Purge destination dirs if possible
[why]
When the file names of the source files change which happened for example
with these commits:
  ac432eb20 Updated Inconsolata source to latest upstream version of 2.001 (WIP #289)
  9c5ad2c78 Updated Inconsolata source to latest upstream version of 2.001 (WIP #289)

or the patched font files naming changes because of any other reason:

The patched-font directory will contain the new files along with the
unchanged old ones (because they where not overwritten).

Typically when manually updating the patched-fonts this is not a
problem, as the maintainer can clean this up by hand (if it is noticed).
But with a github action we might want to have that automatized.

To not deter the usability of the script for end-users or for patching
single fonts of a collection we do NOT want to purge 'all old files'
because we can not know if they are really old or not.

[how]
For each directory that we process from the source fonts we check if all
font files therein match our search criterion (pattern, $2). If we are
going to patch _all_ files that are in that source directory we delete all
font files in the destination directory; expecting that all files will
be recreated.
If we do _not_ patch _all_ files, we can do nothing, because we can not
decide if the existing files originate from one of the
not-to-be-processed source font files or are zombies.

Fixes: #786

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 11:19:19 +02:00
Fini Jastrow
f9f3612e80 Update Font Logos to 1.0.0
[why]
Before Font Logos 1.0.0 there was no stable-codepoint guarantee, and the
later revisions (0.18) reassigned the codepoints. That makes updating
for us very hard, because we would have to resort the icons or follow
the codepoint changes.

With 1.0.0 this changed. That new major release introduced not only a
codepoint guarantee, but it also shifted the codepoints from the F100
region to the F300 region, where we put them anyhow (in most cases).
That is one subset less with 'dynamic base codepoint'.

The reassignment of codepoints in Font Logos kept the codepoints stable
for the icons we already have in release 2.1.0. But at the moment the
2.2.0 Release Candidate (which updated Font Logos with commit 557b8da)
have added glyphs, which are on different points as compared with the
Font Logos 1.0.0 release.

What I want to say, we need to get this straight, before our 2.2.0 RC
turns into a Release 2.2.0.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 11:16:44 +02:00
Fini Jastrow
7bc729e27a gotta-patch-em-all: Allow to specify directory filter
[why]
We can limit the font files to patch with the gotta-patch-em-all script
to some specific file names; the case insensitive beginning of the
basename of the font file, to be specific.

Sometimes we do not know how the actual font files are named, we just
know the directory name.

[how]
The old filter checked for the beginning of a file name, so we keep this
behavior and allow to check for the beginning of a directory name.

As differentiator the first character of the passed filter is used. As a
slash is not allowed in the file name filters: If the first char is a
slash, we search for font files in a directory that begins with that
name. The file name is not considered in this case.

Examples:

gotta-patch-em-all-font-patcher!.sh Fira

  Patches all font files that begin (case insensitive) with 'fira'.
  It must be the basename of the font file, the path to the file is not
  considered. (Old behavior.)
  Translated to a glob this is roughly **/Fira*.[ot]tf

gotta-patch-em-all-font-patcher!.sh /Fira

  Patches all font files that are in directories that begin (case
  insensitive) with 'fira'. It can not be the beginning of the font
  file basename.
  Translated to a glob this is roughly **/Fira*/**/*.[ot]tf

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 11:14:12 +02:00
Fini Jastrow
f287b97048 gotta-patch-em-all: Return error when no file patched
[why]
When we do CI we probably want to raise an error if no font file could
be found.

[how]
Check how many font files have been generated and return with exit
code 1 if the number is zero.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-08-18 11:14:12 +02:00
RL-S
f18c02f345 Allow running gotta-patch-em-all from any dir
The script assumes that it's run from inside bin/scripts, by setting source and target directories according to the output of pwd. It doesn't perform any checks whether it's run from the right directory, so it just doesn't find the fonts if the working directory is different.
Now it sets the directories relative to the script directory.
2022-07-26 15:40:45 +02:00
ashfinal
7f04248439 Add icons for Emacs and Orgmode 2022-05-21 17:17:44 +08:00
Ryan L McIntyre
d2aa06473e RC: use all fonts for matrix 2022-01-03 05:50:16 -08:00
Ryan L McIntyre
3bb002c395 Add font patcher to release in separate job 2022-01-03 02:15:14 -08:00
Ryan L McIntyre
e630dd1697 Fixes use of archive, archive patcher and cleanup 2022-01-03 00:53:22 -08:00
Ryan L McIntyre
c1d81cdda8 Tweak RC for less fonts and try wildcard pattern for artifact upload, comments out commit for now 2022-01-01 07:50:03 -08:00
Ryan L McIntyre
877fef6831 use smaller subset of fonts in RC and do a single commit using artifacts between jobs 2022-01-01 06:48:04 -08:00
Ryan L McIntyre
bd8f3c56eb Get all the fonts for the release matrix 2021-12-31 06:54:14 -08:00
Ryan L McIntyre
c63600d124 Setup release action to pull version from file and commit back upon patching 2021-12-24 03:07:20 -08:00
Ryan L McIntyre
97f28f4a17 Fix info and license generation going to incorrect files 2021-12-11 13:43:48 -08:00
Ryan L McIntyre
2d03a39223 Improves structure and hopefully automated patching of symbol only nerd font variations
* relates to issues #479 #668
2021-12-11 13:43:47 -08:00
Ryan L McIntyre
dd76528ef1
Merge branch 'master' into docker 2021-11-26 18:13:11 -08:00
Ryan L McIntyre
1f350cd22a
Merge branch 'master' into master 2021-11-26 18:02:30 -08:00
Ryan L McIntyre
3ee57228a5 Only patch smaller subset on merging (for now) 2021-11-26 09:52:56 -08:00
Ryan L McIntyre
dc3d40ee86 Archive script doing too much, tweak upload script and add ignore patterns to action 2021-11-26 07:49:18 -08:00
Ryan L McIntyre
0657c3fc6c Setup matrix for actions 2021-11-26 06:48:25 -08:00
Ryan L McIntyre
5c339b84e7 Workflow for building release candidate
* debugging version
2021-11-21 09:05:02 -08:00
Ryan L McIntyre
76ac6cddd5 Tweaks and improvements to archive and upload scripts to work in actions 2021-11-21 07:29:23 -08:00
Ryan L McIntyre
be0069cf91 Merge branch 'puppet_icon' of https://github.com/dhollinger/nerd-fonts into dhollinger-puppet_icon 2021-11-17 12:40:23 -08:00
Vsevolod
b51e17d824 Consider .ttc in docker entrypoint 2021-09-13 21:48:06 +03:00
Dani Llewellyn
e85d9330d5 Update docker-entrypoint.sh
* Add quotes around the variable containing the detected file name in `/in` to allow for spaces in the file names.
2021-08-19 00:04:13 +01:00
David Hollinger III
c01e5f62f8
Add the official Puppet icon as a custom icon 2021-08-13 12:51:35 -05:00
dgswilkins
68ef18e8f4 ensure font-patcher options are handled correctly by docker entry point 2021-05-15 09:51:59 -07:00
Ryan L McIntyre
0d9f3dc84a
Merge pull request #449 from mdschweda/feature-docker-support
Docker support
2021-04-19 21:39:09 -07:00
Ryan L McIntyre
e5828af6d3 Fix exit code when file not existing 2021-04-11 12:47:46 -07:00
Ryan L McIntyre
3deb6166be
Merge pull request #551 from daniruiz/master
Update font-logos with new linux icons
2021-04-10 20:56:06 -07:00
andys8
2bf091cd76 purescript icon in font patcher 2020-12-06 21:39:11 +01:00
Daniel Ruiz de Alegría
557b8da5c5 Update font-logos with new linux icons 2020-12-03 20:00:54 +01:00
Ryan L McIntyre
5f748cdb10 Updates regex for matching more license files (issue #463) 2020-04-13 14:52:33 -07:00
Ryan L McIntyre
5aa3f340d7 Add license files to zip archives along with mini readme 2020-04-13 03:44:46 -07:00
Ryan L McIntyre
85eb82d430 Adds license files to release archives 2020-04-13 02:41:52 -07:00
Ryan L McIntyre
9bbf817f77 Add license files to patched font directory and subdirectories as well as some clean-up and refactoring 2020-04-12 03:52:31 -07:00
Ryan L McIntyre
bc12c2281f Add support for generating info as well as specifying a like pattern (first param to script) 2020-04-12 03:51:29 -07:00
Ryan L McIntyre
c27674d650 Adds a very basic script to update all contributors section on the website 2020-04-06 01:02:15 -07:00
Ryan L McIntyre
0d51729d84 Updates image preview names to match the generated ones 2020-04-06 01:02:15 -07:00
Marcus Schweda
07505ef276 Docker image 2020-03-05 18:40:18 +01:00
Anton Maminov
3bdc0949b8 add Crystal icon 2020-01-29 13:53:56 +02:00
Ryan L McIntyre
0b66b58fa8 Use the most optimal compression level of zip just in case 2020-01-18 21:18:14 -08:00
Ryan L McIntyre
2cb0488aaf Fixes issue with same file name after paths are junked with '-j' option (e.g. Gohu) (issue #418) 2020-01-18 21:11:26 -08:00
Ryan L McIntyre
601e5a150f Fixes version bumping 2019-11-22 20:58:44 -08:00
Ryan L McIntyre
581521fd14 Fixes archive script 2019-11-21 07:05:58 -08:00
Ryan L McIntyre
8566c6539e Updates scripts in preparation for for v2.1.0 2019-11-03 09:08:39 -08:00
Ryan L McIntyre
9b3d15cda6 Updates script to use json data file instead of fc-list
* adds json file
2019-10-12 11:59:13 -07:00
Ryan L McIntyre
c2041db74f Updates script to use json data file instead of fc-list 2019-09-12 14:22:39 -07:00
Ryan L McIntyre
24936a14e2 Adds regular (non Inkscape) template svg used by script to generate font previews 2019-09-05 14:34:00 -07:00
Ryan L McIntyre
4cd5e1c54f Adds base template svg used by script to generate font previews 2019-08-27 14:02:52 -07:00
Ryan L McIntyre
84d4eab4cb Adds ability to pass in font name to filter the find by
* instead of having dirty/hacky comment/uncomment code for testing
2019-08-17 12:21:36 -07:00
Ryan L McIntyre
bb28b5d96b Cheatsheet correction (fixes #285) 2019-08-15 14:41:20 -07:00
Ryan L McIntyre
8e34142d62 Adds first version of script to generate svg image previews for the website 2019-08-15 13:57:52 -07:00
Ryan L McIntyre
9331307d16 Reduce size of generated CSS file by only using the short prefix of NF 2019-08-11 14:20:42 -07:00
Ryan L McIntyre
7a4b5f872f Fixes build errors (ShellCheck) 2019-08-11 07:30:38 -07:00
Ryan L McIntyre
2f13a0d269 Adds missing Weather Icons from script 2019-08-01 14:08:11 -07:00
Andrew Newman
e8e191a1be Update bash shebangs 2018-07-09 18:18:12 +03:00
Ryan L McIntyre
645145a7a3 Fixes to pattern and case sensitivity 2018-04-01 16:30:03 -04:00
Ryan L McIntyre
d17f1bc333 Fixes Control Instruction File for Bold 2018-04-01 15:42:09 -04:00
Ryan L McIntyre
78954bfecf Only delete based on pattern 2018-04-01 15:39:36 -04:00
Ryan L McIntyre
d1143347e0 Updates to be runnable everywhere and remove archives before run 2018-04-01 11:29:01 -04:00
Ryan L McIntyre
5949727565 Updates for better codepoint vs class display 2018-04-01 10:37:51 -04:00
Ryan L McIntyre
d88fde3995 Updates glyph helper script and fixes Weather codepoint refs (WIP #247)
- Updates glyph generating helper script with offset range nogaps
- Rebuilds Weather variables set
2018-03-23 21:05:52 -04:00
Ryan L McIntyre
1906150729 Updates patcher and source script for Weather glyph set (issue #247) 2018-03-23 21:05:52 -04:00
Ryan L McIntyre
84a6bc8419 Updates counts and missing combinations from generation 2018-03-18 18:00:26 -04:00
Ryan L McIntyre
59c23aa07c Updates hint fixes for Hack v3.003
- updated glyph names since FontForge changes some of them
2018-03-17 20:53:28 -04:00
Ryan L McIntyre
ff4f215932 Makes autohint callable from other locations and updates Hack post process scripts 2018-03-17 20:33:15 -04:00
Ryan L McIntyre
1d84436942 Updates 'Knack' to now be just 'Hack' (license change)
- Removes reliance on 'Knack' name due to removal of SIL OFL Reserved font name 'Hack' no longer being a RFN
- This change has been in effect since Hack v3.000
2018-03-17 11:50:06 -04:00
Ryan L McIntyre
916a3d0634 Fixes search to be case insensitive 2018-03-10 21:39:34 -05:00
Logan Holmes
db54e9cf0e
Fix test flag for $__i_weather_loaded 2018-03-05 09:40:48 -08:00
Ryan L McIntyre
4656190995 Fixes incorrect metadata 2018-03-03 14:14:55 -05:00
Ryan L McIntyre
b7931da607 Updates version metadata consistency 2018-03-03 14:14:55 -05:00
Ryan L McIntyre
e8f77401e4 Fixes ShellCheck SC2076 2018-02-28 21:41:46 -05:00
Ryan L McIntyre
b7e5f8e1ef Fixes not all fonts being parsed
- script needs rework
2018-02-28 21:36:52 -05:00
Ryan L McIntyre
524a10c962 Fix to not remove 'monospace' when updating 2018-02-28 20:28:41 -05:00
Ryan L McIntyre
f8fda5c985 Version bumps in preparation for v2.0.0 release 2018-02-26 05:43:15 -05:00
Ryan L McIntyre
bfc040ab9c Adds specific nerd fonts version replacement 2018-02-26 05:42:47 -05:00
Ryan L McIntyre
3c128eee3b Updates build patcher to use new flags/options 2018-02-25 21:52:36 -05:00
Ryan L McIntyre
5007170cf9 Updates glyph core set (SetiUI and custom) with new glyphs for Elm, Elixir, Electron (WIP #172, #228, #237) 2018-02-25 16:15:13 -05:00
Ryan L McIntyre
f1e7c7c148 Clean-up 2018-02-23 07:54:57 -05:00
Ryan L McIntyre
b7497e3e65 Updates generated CSS in preparation for Weather Icons (WIP issue #226) 2018-02-15 19:40:16 -05:00
Ryan L McIntyre
7141881b71 Updates scripts in preparation for Weather Icons (WIP issue #226) 2018-02-15 19:35:26 -05:00
Ryan L McIntyre
6955ac2bdb Updates scripts in preparation for Weather Icons (WIP issue #226) 2018-02-15 17:46:19 -05:00
Ryan L McIntyre
780abd4432 Updates to allow passing in prefix and outputing the count of glyphs 2018-02-14 21:28:26 -05:00
Ryan L McIntyre
6a605d91fd Fixes incorrect prefix 2018-02-13 22:01:10 -05:00
Ryan L McIntyre
28d412ac0b Updates scripts in preparation for updating font-logos (font-linux) (WIP issue #157) 2018-02-13 21:59:17 -05:00
Ryan L McIntyre
1ae39f339e Updates scripts in preparation for Material Design Icons (WIP issue #154) 2018-02-12 21:32:37 -05:00
Ryan L McIntyre
f3a1e734e6 Adds helper script for generating variable helper scripts 2018-02-12 21:25:45 -05:00
Ryan L McIntyre
09c2af1d71 ShellCheck fixes WIP (related to #120) 2018-01-12 22:29:25 -05:00