Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added characters for c0 and c1 codes #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added characters for c0 and c1 codes #83

wants to merge 1 commit into from

Conversation

KOLANICH
Copy link

Hello, here is the glyphs for C0 and C1 codes.

@jfkthame
Copy link
Contributor

It's not clear to me that it is desirable to have visible glyphs assigned to all the C0 and C1 code positions (or indeed to any of them -- what is the intended use case for these?).

In particular, in TrueType fonts several of these characters are expected, according to Microsoft recommendations[1], to have blank glyphs.

Note also that visible representations of C0 control codes (and a few others) are encoded separately in Unicode; see the Control Pictures block at U+2400. The control codes themselves are not expected to have visible glyphs.

I'm not sure how these .ufo files were created, but when imported into Glyphs.app they look like the outlines are somewhat broken -- it looks like many of the curved outlines are not closed correctly, and end up finishing with a straight line where a curve would be expected. (I suspect this may be a Glyphs bug rather than an error in the files, but have not investigated more deeply.) But when I tried to import them into FontForge for comparison, it crashed....

In any case, these glyphs are fundamentally unsuitable for Fira Mono because they do not have the correct (monospaced) width to be compatible with the font.

[1] http://www.microsoft.com/typography/otspec/recom.htm

@KOLANICH
Copy link
Author

It's not clear to me that it is desirable to have visible glyphs assigned to all the C0 and C1 code positions

The purpose was to use this fonts in debug output and web IDEs to have more control over output.

see the Control Pictures block at U+2400

this block in fact contains another characters, you cannot just copy them and get what they really meant to be

I'm not sure how these .ufo files were created
But when I tried to import them into FontForge for comparison, it crashed....

They were created in fontforge. At first I created a prototype font with these chars (validated, so there musn't be such things as unclosed contours) and tested it. (and the font was exported correctly, without crash).

Then I just exported that font into .ufo and manually merged with fira mono (just copied files and copied some rows into contents.plist) because I haven't managed to copy them from font to font using fontforge (instead of this fontforge replaces the last glyph), maybe this caused the crash

In any case, these glyphs are fundamentally unsuitable for Fira Mono because they do not have the correct (monospaced) width to be compatible with the font.

They were inspired by Notepad++ ones. I can try to fix them. Would it be OK if they were twice as wide as regular chars?

Also would it be OK, if I replaced space glyph with a dot and tab one with an arrow?

@jfkthame
Copy link
Contributor

On 16/5/15 19:31, KOLANICH wrote:

It's not clear to me that it is desirable to have visible glyphs
assigned to all the C0 and C1 code positions

The purpose was to use this fonts in debug output and web IDEs to have
more control over output.

Some rendering systems will not display control codes using glyphs from
the font anyway, because they know these are not supposed to be graphic
characters.

In any case, these glyphs are fundamentally unsuitable for Fira Mono
because they do not have the correct (monospaced) width to be
compatible with the font.

They were inspired by Notepad++ ones. I can try to fix them. Would it be
OK if they were twice as wide as regular chars?

I don't think so. If there are glyphs that have a different advance
width, some programs will refuse to recognize the font as being
monospaced -- see issue 56.

Also would it be OK, if I replaced space gluph with a dot and tab one
with an arrow?

Not as their default rendering; if anything, that could be done as an
optional font feature.

But in general, software that supports "show invisibles" or similar
features will use alternative character codes (such as the U+2400 block)
or other rendering approaches. Fonts are not expected to provide glyphs
for the C0/C1 character codes, as they are control codes, not graphic
characters.

@KOLANICH
Copy link
Author

Some rendering systems will not display control codes using glyphs from the font anyway, because they know these are not supposed to be graphic characters.

at least Firefox and old Opera do.

@jfkthame
Copy link
Contributor

On 17/5/15 13:58, KOLANICH wrote:

Some rendering systems will not display control codes using glyphs
from the font anyway, because they know these are not supposed to be
graphic characters.

at least Firefox and old Opera do.
https://bugzilla.mozilla.org/show_bug.cgi?id=1148903

Yes, I know; I recently implemented that change in Firefox. Though note
that it's only for webfonts (i.e. loaded via font-face rules); it will
not render those characters when using installed fonts directly.

Before this can be considered, though, the issue of the glyph widths
still needs to be addressed. We can't have double-width glyphs in Fira
Mono, as that makes it no longer monospaced. So a different design may
be more appropriate (perhaps making more use of vertical space?).

@mickeyl
Copy link

mickeyl commented Sep 28, 2018

@KOLANICH Thanks a lot for this pull request. I would love to use this font, since I'm working on a hex editor. I can't find any way to build the OTF fonts from the UFO sources though, ufo2otf seems to segfault here. Could you consider releasing a prebuilt version of Fira Mono with C0 and C1, please? Best regards and thanks again!

@KOLANICH
Copy link
Author

KOLANICH commented Sep 28, 2018

@mickeyl, I used FontForge (if I remember right - with some plugin for importing ufo). Unfortunately currently I don't have the access to the prebuilt version.

@mickeyl
Copy link

mickeyl commented Oct 2, 2018

Ok, thanks anyways. Unfortunately FontForge complains about a lot of errors in the .ufo file and then bails out with a SIGSEV, so I can't build the fonts.

% python2
Python 2.7.15 (default, Jul 23 2018, 21:27:06)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import fontforge
>>> f="Fira Mono-Regular.ufo"
>>> fontforge.open(f)
Failed to find glyph dotlessj when fixing up references.
Reference to a non-existent glyph name on line 362 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 362 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 364 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 364 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 368 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 368 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 368 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 369 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 369 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 369 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 373 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 373 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 373 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 374 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 374 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 374 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 376 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 376 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 390 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 390 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 395 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 395 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 415 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 415 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 422 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 422 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 423 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 423 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 424 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 424 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 499 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 499 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 516 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 516 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 520 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 520 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 520 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 521 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 521 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 522 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 522 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 522 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 523 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 523 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 523 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 524 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 524 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 524 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 569 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 569 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 569 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 570 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 570 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 570 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 571 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 571 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 571 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 575 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
Empty substitute on line 575 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 575 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 589 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 589 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Reference to a non-existent glyph name on line 590 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea.
No substitution specified on line 590 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected 'by' or 'from' keywords in substitution on line 591 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
Expected ';' at statement end on line 591 of /Users/mickey/Documents/late/misc/FiraCode/source/ufo/Fira Mono-Regular.ufo/features.fea
There were errors when parsing the feature file and the features have not been applied
<fontforge.font at 0x0x10cbf5670 "Fira Mono-Regular">
>>> font=fontforge.open(f)
>>> font
<fontforge.font at 0x0x10cbf5670 "Fira Mono-Regular">
>>> font.generate("/tmp/foo.otf",flags=("round"))
[1]    1905 segmentation fault  python2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants