mnater / Hyphenopoly

Hyphenation for node and Polyfill for client-side hyphenation.
http://mnater.github.io/Hyphenopoly/
MIT License
689 stars 45 forks source link

Wrong hyphen characters on MacOs with chromium browsers #177

Closed ReLater closed 2 years ago

ReLater commented 2 years ago

I just want to report this issue here because I have no possibilities to test it (I have no Mac or so).

Thank you!

grafik

A typical configuration block that the plugin sets for de-de:

// Early script that implements a addClass function for .hyphenate and .donthyphenate classes.
<script src="/media/plg_system_hyphenateghsvs/js/hyphenateghsvsVanilla.js?1642069734"></script>

// Adds classes to configured selectors
document.addEventListener("DOMContentLoaded", function(){
 var selectors = new Hyphenateghsvs(".div4hyphens");
 selectors.addClass("hyphenate");
 var selectors = new Hyphenateghsvs(".icons, code, .code-filename");
 selectors.addClass("donthyphenate");});

// Later
    <style>.hyphenate{word-wrap:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;-o-hyphens:auto;hyphens:auto}.donthyphenate{word-wrap:break-word;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;-o-hyphens:none;hyphens:none}</style>

    <script>;var Hyphenopoly = {
    "require": {
        "de-de": "Silbentrennungsalgorithmus"
    },
    "fallbacks": {
        "de-de": "de"
    },
    "paths": {
        "patterndir": "/media/plg_system_hyphenateghsvs/js/hyphenopoly/patterns/",
        "maindir": "/media/plg_system_hyphenateghsvs/js/hyphenopoly/"
    },
    "handleEvent": {
        "error": function (e) {e.preventDefault();}
    },
    "setup": {
        "hide": "element"
    }
};</script><script src="/media/plg_system_hyphenateghsvs/js/hyphenopoly/Hyphenopoly_Loader.js"></script>

"handleEvent" and "hide" are variable.

One user has also tested with "FORCEHYPHENOPOLY".

Other user never has answered on my questions

mnater commented 2 years ago

Hi

This looks like an issue with the font. Some webfonts don‘t support the complete charset. The soft hyphen witch Hyphenopoly inserts is often among those unsupported charcters.

I believe some browsers fall back to other fonts for unsupported chars.

Do you know the font used in the example? I‘d like to investigate this issue (I have a Mac).

ReLater commented 2 years ago

On the page where the image above is from:

font-family: Hind;

No fallback font in CSS as far as I see. Included via fonts.gstatic.com.

On the other page

font-family: 'Roboto';

No fallback font in CSS for the relevant areas as far as I see. Included via fonts.gstatic.com.

mnater commented 2 years ago

Those fonts support the soft hyphen. Just googled this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1267606

I can't do anything but wait for Feb 01 2022.

ReLater commented 2 years ago

Thank you for investigations! I found a lot but not that issue. Let's see.

ReLater commented 2 years ago

Nur zur Info. Ich habe gerade Nachricht erhalten:

Habe eben ein CHROME Update auf meinem MacBook gemacht, jetzt geht es auch mit dem "-".