• Resolved Derek

    (@itsonlyinsane)


    The intelligent character replacement for hyphens/dashes changes the font of the standard hyphen glyph (the one used for compound-words), but doesn’t seem to change the typeface for em and en dashes. On my own website, the difference in stroke weight between the hyphens and surrounding text stands out.

    This effects my website, but also the author’s (see https://code.mundschenk.at/wp-typography/ where hyphens are set in Helvetica and Lucida Grande instead of Gill Sans and Hoefler Text).

    Would this be a styling issue or a missing glyph issue?

    Disabling the “smart dashes” option returns the hyphens to normal, but I’d rather not lose the functionality.

    • This topic was modified 5 years, 10 months ago by Derek.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author pepe

    (@pputzer)

    Yes, that’s browser-specific fallback behavior for missing glyphs. As you can see from the generated markup, there’s no font-face change for any of the smart dashes, they are all part of the same text node as the surrounding letters.

    Thread Starter Derek

    (@itsonlyinsane)

    What is the unicode character that the plugin is trying to insert?

    Plugin Author pepe

    (@pputzer)

    You can see the named constants in this file from the PHP-Typography library. As for specific dashes, it depends on the selected dash style and position, but it’s unicode em-dash, en-dash, minus, etc. The specific algorithm can be found in the Smart Dashes fix.

    Thread Starter Derek

    (@itsonlyinsane)

    Thank you for those links.

    I can see that the plugin is replacing the more generic “hyphen-minus” (U+002D) for the more specific “hyphen” (U+2010), and that it has been since 6.3.0.

    Would it be possible to add a toggle to the plugin that switches that behavior on and off?

    From the commit, I see you noted that the reason for making this change was dropping IE6 legacy support:

    Use real Unicode hyphen instead of hyphen-minus (since IE6 is long dead).

    I’m all for choosing the typographically correct options, but I think there are still too many fonts that don’t support the U+2010 hyphen.

    • This reply was modified 5 years, 10 months ago by Derek.
    Plugin Author pepe

    (@pputzer)

    I’ll have to add a setting to PHP-Typography first. There is a ticket for that, but I have not had time to think about the design yet, so it will take some time.

    Meanwhile, you could add a filter to the various hooks to replace the ′MINUSwith plain oldHYPHEN-MINUS`. This should fix the issue at the markup level.

    • This reply was modified 5 years, 10 months ago by pepe.
    Thread Starter Derek

    (@itsonlyinsane)

    Thank you for that info.

    I was curious and checked around for how many fonts support the character. 43/1728 font families on Adobe Typekit and 143/915 on Google Fonts.

    Plugin Author pepe

    (@pputzer)

    @itsonlyinsane I’ll change the default back in the next release.

    Thread Starter Derek

    (@itsonlyinsane)

    Thank you for the update!

    Plugin Author pepe

    (@pputzer)

    Progress can be tracked via GitHub.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hyphens set in wrong font’ is closed to new replies.