xkcd-font icon indicating copy to clipboard operation
xkcd-font copied to clipboard

And the language geek asks for IPA...

Open HughP opened this issue 9 years ago • 24 comments

@randallmunroe and others (@kolbylyn @rgbkrk ), I was reading the discussion on #9 and... Sooo I thought I'd ask, is it beyond all geekery sensibleness to ask for IPA characters to be added to the font? I mean we're not all astronomy and math students who read xkcd.... ;-) If we can start with some hand writing samples again, I'll look at reaching out to some font developers and adding the glyphs to the font proper... but I'd need the original hand writing samples. I guess much like what was asked for and provided in #9.

HughP avatar Apr 06 '15 07:04 HughP

As a start, here are the ones for Czech:

Á É Í Ó Ú Ů Ý Č Ď Ě Ň Ř Š Ť Ž á é í ó ú ů ý č ď ě ň ř š ť ž

certik avatar Sep 01 '17 02:09 certik

As a start, here are the ones for Czech: Á É Í Ó Ú Ů Ý Č Ď Ě Ň Ř Š Ť Ž á é í ó ú ů ý č ď ě ň ř š ť ž

@certik It may be possible to manufacture these glyphs from what we already have. It would involve a bit of programatic hack and slice of the glyphs coming out of https://github.com/ipython/xkcd-font/blob/master/xkcd-script/samples/handwriting.png, but it is conceivable to do a good-enough job of it.

No such luck for the IPA characters though...

pelson avatar Oct 11 '17 05:10 pelson

I frequently view XKCD comics using XKCD Open Source which uses this font. Unfortunately, of the German diacritics, this font only supports Ü. This means that sights like "ERKLäREN" are common where ä is in a fallback font. Could Ä/ä, Ö/ö, Ü/ü, and ẞ/ß be added to this font? In 1647 Diacritics, there are several diacritics that could be the source for these additions: résümȩ̊́́́̆.́́́

thaliaarchi avatar Jan 23 '19 23:01 thaliaarchi

I was using this font for handwritten-looking diagrams for my courses in French, when I realized the accented characters were standing out like boring type... XKCD or OCD? image

fuhrmanator avatar Dec 06 '19 20:12 fuhrmanator

I found another missing character I use all the time today; and now I must write "sans em-dash".

HughP avatar Nov 18 '20 07:11 HughP

I add accented letters (includes cedilla, ogonek, caron, breve), en-dash, em-dash, degree, minus (longer than hyphen-minus), multiply, long s, etc., and kernings. https://github.com/dummy-index/xkcd-font/tree/brushup/xkcd-script/font

dummy-index avatar Dec 06 '20 10:12 dummy-index

@dummy-index do you have a total list of characters? when you added accented letters did you add these accents as combining diacritics or as composite character/pre-composed characters?

HughP avatar Dec 06 '20 18:12 HughP

@HughP

as combining diacritics or as composite character/pre-composed characters?

Both. precomposition runs based on the Unicode Character Database. Like a 1647: Diacritics

a total list of characters

charlist.txt

import os
import fontforge
base = '../font/'
ttf = os.path.join(base, 'xkcd-script.ttf')
font = fontforge.open(ttf)
glyph_iter = font.__iter__()
for glyphname in glyph_iter:
	if font.__contains__(glyphname):
		glyph = font.__getitem__(glyphname)
		if glyph.unicode >= 0:
			print(hex(glyph.unicode))
font.close()

dummy-index avatar Dec 07 '20 13:12 dummy-index

@dummy-index I was looking at the font metadata, and it says "Version 1.0" But is this still accurate?

HughP avatar Dec 13 '20 19:12 HughP

@HughP I'm thinking, but want to change the version number system to such as 1.000 . (my immediate goal is Ver. 1.100, and release candidates are 1.090, 1.091, ...)

dummy-index avatar Dec 16 '20 14:12 dummy-index

Well I definitely recommend semantic versioning https://semver.org/ BUT in this case, IF I understand the creative work you released, I think it is a fork of the original. In that case it needs to indicate that.... Something like this: https://dylanbeattie.net/2017/01/26/semantic-versioning-with-powershell_26.html But I have never done this before, but I am interested in this notation for other professional projects I am involved with.

HughP avatar Dec 16 '20 23:12 HughP

Mmm... What is the public API of this font? Which do you think the "Version 1.0" of master corresponds to, 1.0.0 or 0.1.0? Or set the version number of the generator script? Certainly I should add some string to the version, because I'm an outsider of ipyhon project.

dummy-index avatar Dec 19 '20 14:12 dummy-index

  1. I am not sure that one can equate a version of a font to an API. So, I don't think there is a public API of a font.
  2. I think that "Version 1.0" = 1.0.0
  3. Good question. Have you reached out to the original project (from which you forked) to ask them for feed back? They might accept your contribution and increment their version number rather than introducing a variant in the wild.
  4. Definitely add a string to indicate it is a variant of an other project.

HughP avatar Dec 19 '20 19:12 HughP

In semantic versioning, major revisions are "breaking" changes. I could think of that as a document using this font would look differently after a major revision.

Adding new characters that weren't previously supported would be a minor revision.

Fixing a character that displayed improperly would be a patch.

fuhrmanator avatar Dec 20 '20 00:12 fuhrmanator

I don't intend to establish another project. At first, there were some reason to hesitate PR-ing. (#34 #36) Now I has been able to build the font file in same way as pelson. I'll PR after some more things.

I think my most "breaking" change is the kerning. (Although it's no effect for apps not supporting 'kern,' Microsoft says "This feature should be active by default" hence it should be treated as breaking change.) my kernings are bit too condensed for small-point text.

dummy-index avatar Dec 20 '20 14:12 dummy-index

FYI: something to think about. I converted the font to wott2 for internet use and found two issues which could use some "tweaking"...

  1. the bigraph "cc" looks unnatural. "c" is raised and this I think is part of the effect of the handwriting, but the second "c" should not be the exact same height. It either needs to randomly be even higher or lower, or consistently the same height as an "e" or there abouts.
  2. There is no combining macron below diacritic U+0331 ◌̱ in the current version. I would think that the glyph for hyphen-minus or en-dash could be used for the character in question, an the lowered height would likely be the same as the amount from bottom as the above the base diacritics would be found. Some examples of underlining are seen in: https://xkcd.com/1051/ https://xkcd.com/285/, however, underlining is not the same as the combining macron below... The image below shows the "cc" bigraph, and also the fall-back nature needed for use of U+0331. xkcd2

Job Well done on the creation of non-breaking hypen, and of the grave and acute diacritics. Those all work for me.

Note: Macron below, U+0331 ◌̱ COMBINING MACRON BELOW, is a combining diacritical mark that is used in various orthographies. It is not to be confused with U+0320 ◌̠ COMBINING MINUS SIGN BELOW, U+0332 ◌̲ COMBINING LOW LINE and U+005F _ LOW LINE.

HughP avatar Dec 23 '20 19:12 HughP

I could add Esperanto letters (Ĉ, Ĝ, Ĥ, Ĵ, Ŝ, Ŭ, ĉ, ĝ, ĥ, ĵ, ŝ, ŭ) using Fontforge. Here is the result:

robota-estonteco

I don't know how to contribute this, so if this addition interests you, I ask you to guide me on how to contribute.

jorgesumle avatar Sep 06 '23 10:09 jorgesumle

Would these then be Precomposed Characters, or diacritics? In IPA contexts diacritics are very useful.

https://en.wikipedia.org/wiki/Precomposed_character

On Wed, Sep 6, 2023 at 5:23 AM Jorge Maldonado Ventura < @.***> wrote:

I could add Esperanto letters (Ĉ, Ĝ, Ĥ, Ĵ, Ŝ, Ŭ, ĉ, ĝ, ĥ, ĵ, ŝ, ŭ) using Fontforge http://designwithfontforge.com/en-US/Diacritics_and_Accents.html. Here is the result:

[image: robota-estonteco] https://user-images.githubusercontent.com/14212780/265976039-ec858854-4fb0-46b4-a69d-5035e7fc660a.png

I don't know how to contribute this, so if this addition interests you, I ask you to guide me on how to contribute.

— Reply to this email directly, view it on GitHub https://github.com/ipython/xkcd-font/issues/11#issuecomment-1708073092, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAJ2JU3UVWXEDAXCQ4OJTDXZBFI3ANCNFSM4A7K66PA . You are receiving this because you were mentioned.Message ID: @.***>

HughP avatar Sep 06 '23 13:09 HughP

I did it adding individual diacritics, and then combining them with letters to create the Unicode characters I needed (see the linked guide).

jorgesumle avatar Sep 06 '23 17:09 jorgesumle

I don't intend to establish another project. At first, there were some reason to hesitate PR-ing. (#34 #36) Now I has been able to build the font file in same way as pelson. I'll PR after some more things.

Any chance you'd PR it now? It'd be really helpful to get it in for https://github.com/matplotlib/matplotlib/pull/27299 / https://github.com/matplotlib/matplotlib/pull/26854

story645 avatar Nov 13 '23 21:11 story645

Oh, thank you for your concern. There are a few things to do...

  1. "OCH" ligature fails in some application. Reference says liga table must be sorted. (soon)
  2. Add some ligatures to gain more handwriting effect.
  3. It is difficult to distinguish "æ" from "œ". I want "open a". cf. 2251: Alignment Chart

dummy-index avatar Nov 17 '23 15:11 dummy-index

Some notes as I was recently asked personally what was the state of this repository.

I don't think many of the committers in this repository really all know what they are doing with fonts, and we likely all had notification off.

Personally I have no clue how to build a font file, how to add a character. Though if some of you want know how to do that, and have a nice way to be able to review the changes, I would be happy to merge it.

Among other I guess a demo page (like https://monaspace.githubnext.com/), would be nice.

I guess a really nice first step would be for someone that understand how this repo work to help fill the .github/CONTRIBUTING.md that appear to be empty. (even if it's just sending a PR that say "we know this file is empty please help us completing it", or better dig through history to see why it's empty.

Thanks,

Carreau avatar Nov 17 '23 15:11 Carreau

Though if some of you want know how to do that, and have a nice way to be able to review the changes, I would be happy to merge it.

Same. I sometimes come over to the repo to get the font but it's all greek to me.

rgbkrk avatar Nov 18 '23 06:11 rgbkrk

FWIW, I keep an eye here from time-to-time too. I dream of finding the time to extend the with the desired characters, but the reality is that I am not going to be able to invest enough effort to do it well. FWIW I think the steps I would take to achieve it:

  • Manually generate a number of the desired characters using GIMP/Inkscape, and save them in a "generated characters" png (much like the actual handwriting sample one)
  • Include this in the font generation, taking into account the thickness/size/kerning details of the original script

This will require some upfront maintenance:

  • The repository is based on use of Travis-CI - the first thing to do would be to get it working in github actions
  • The software stack I used originally was quite fragile - in the end I published the docker image because I wasn't able to re-build FontForge reliably at the time. I'm sure FontForge has moved forwards a long way since then, and so it would be great if the image being used was more standard (or even apt/apk installed versions of FontForge used)

Whilst I don't have the capacity to do these things, I would be happy to support somebody who is motivated to give it a go.

pelson avatar Nov 19 '23 19:11 pelson