styles icon indicating copy to clipboard operation
styles copied to clipboard

Prohibit problematic font characters?

Open rmzelle opened this issue 9 years ago • 12 comments

@adam3smith mentioned that font support for narrow non-breaking spaces is rather abysmal, which might be a good reason to limit or even prohibit the use of this character in our repository.

See https://github.com/citation-style-language/styles/pull/2039#issuecomment-215536922

These are the styles that currently use narrow non-breaking spaces:

C:\GitHub\styles\annales.csl
143: <group delimiter="&#8239;">
162: <group delimiter="&#8239;">
174: <group delimiter="&#8239;">
191: <group delimiter="&#8239;">
276: <group delimiter="&#8239;">
297: <group delimiter="&#8239;">
C:\GitHub\styles\iso690-note-fr.csl
81: <text value="Inventeur(s)" suffix="&#8239;: "/>
128: <text term="in" text-case="capitalize-first" suffix="&#8239;: "/>
522: <text term="available at" suffix="&#8239;: " text-case="capitalize-first"/>
529: <group delimiter="&#8239;:&#160;">
569: <group delimiter="&#8239;: ">
606: <group delimiter="&#8239;: ">
626: <layout suffix="." delimiter="&#8239;; ">
C:\GitHub\styles\le-tapuscrit-note.csl
191: <group delimiter="&#8239;">
214: <group delimiter="&#8239;">
230: <group delimiter="&#8239;">
255: <group delimiter="&#8239;">
C:\GitHub\styles\pour-reussir-note.csl
157: <group delimiter="&#8239;">
175: <group delimiter="&#8239;">
191: <group delimiter="&#8239;">
207: <group delimiter="&#8239;">

Open questions:

  • is bad font support enough of a problem that we want to avoid this character?
  • should we actively screen for this? (e.g. with Travis)
  • are there other characters with the same issue?

rmzelle avatar May 16 '16 17:05 rmzelle

  1. I'm actually surprised we don't get more complaints about this. Support is really quite bad. I think only 1 in 3 fonts on my computer had the character defined. The only explanation I have is that almost everyone is using Times New Roman, which does have this covered. But maybe I'm missing something.
  2. I'd tend to say yes (unless, as per 1, I'm missing something).
  3. non-breaking hyphens are in about the same category (which is too bad: they're great)

adam3smith avatar May 16 '16 17:05 adam3smith

I guess I'd want to test out more what actually happens in those styles across fonts. Give me a couple of days for that.

adam3smith avatar May 16 '16 18:05 adam3smith

non-breaking hyphens are in about the same category

Do you have the unicode/HTML code for that?

rmzelle avatar May 16 '16 18:05 rmzelle

http://www.fileformat.info/info/unicode/char/2011/index.htm

adam3smith avatar May 16 '16 18:05 adam3smith

We currently don't have any of those, then. I escape non-breaking hyphens in the maintenance script (https://github.com/citation-style-language/utilities/blob/d6bc1f23f560c1d92d8b5772dece7aba37c6bb55/csl-reindenting-and-info-reordering.py#L153), and none of our styles have the escaped character: https://github.com/citation-style-language/styles/search?utf8=%E2%9C%93&q=8209&type=Code

rmzelle avatar May 16 '16 18:05 rmzelle

Hello, I just came across your discussion by chance, which is fortunate since I started a similar one on Zotero forums a few days ago (https://forums.zotero.org/discussion/comment/267584#Comment_267584). I have bypassed non-breaking hyphens in the style I am currently editing (see my latest pull request here : https://github.com/citation-style-language/styles/pull/2422), but I can't find a way to avoid narrow non-breaking spaces, which are a real problem. I understand they are the right character to use in specific cases, but they cause issues with many fonts, so I agree we should try and offer a way to avoid using them. Best,

ahahl avatar Jan 13 '17 14:01 ahahl

Why does american physics society have a non-breaking space as part of the citation prefix? More importantly, should it?

https://github.com/citation-style-language/styles/blob/master/american-physics-society.csl#L96

EDIT: I see the commit here https://github.com/citation-style-language/styles/commit/92a28c9cfed7b9be982adc2c8459c9ee9a6f6b74.

But I'm still confused why there was a preceding space to begin with.

bdarcus avatar Mar 31 '22 17:03 bdarcus

Most numeric styles don't want a space between the document text and the citation number, but this style wants a space between them.

on-line numerals in square brackets (Jones [1]); these are spaced away from the preceding word or symbol, and are placed inside punctuation

This prefix is here presumably to facilitate changing between numeric styles with the more common requirements and APS's unusual requirement. That makes sense to me for the population of authors that would be affected

As to which character, I think narrow no break space is typographically best, but has the support issues noted here. We might consider changing it to regular no break space?

bwiernik avatar Mar 31 '22 20:03 bwiernik

This prefix is here presumably to facilitate changing between numeric styles with the more common requirements and APS's unusual requirement. That makes sense to me for the population of authors that would be affected

OK. It just seems kind of hack-ish to me. But if nobody has raised it ...

bdarcus avatar Apr 01 '22 16:04 bdarcus

I imagine the most important part here is that whoever wrote it wanted the citations to be non breaking and never begin a line. Seems reasonable to me

bwiernik avatar Apr 01 '22 17:04 bwiernik

The issue someone was noting to me (on the org list) was less the non-breaking space than the fact that the space preceding the citation was included in the style, while often/typically they are not. So they were getting inconsistent spacing across numeric styles.

bdarcus avatar Apr 01 '22 17:04 bdarcus

I think that's the point. Most numeric styles explicitly do not want a space before the citation, whereas APS does. So a difference across CSL styles is intentional to meet style requirements

Personally, I wish a decade ago we had established the convention that author-date citations included a space in the prefix for this reason, but that ship has sailed

bwiernik avatar Apr 01 '22 18:04 bwiernik