Giter VIP home page Giter VIP logo

Comments (3)

NightFurySL2001 avatar NightFurySL2001 commented on May 29, 2024 1

Thank you for the quick response. You might also need to change the OS/2.fsSelection too to reflect the weight change according to name specification from Microsoft.

Also from the site,

While some platforms or applications do not have this constraint, many existing applications that use this pair of names assume that a Font Family name is shared by at most four fonts that form a font style-linking group, and that Font Subfamily names would reflect one of the four basic styles, regular, italic (or oblique), bold, and bold italic (or bold oblique). To be compatible with the broadest range of platforms and applications, it is strongly recommended that fonts should limit use of Font Family in this manner.

Thus, it might be more reasonable to let both platforms use the same set of constrain, unless Mac softwares are able to differentiate family name other than Regular and Bold.

from glow-sans.

NightFurySL2001 avatar NightFurySL2001 commented on May 29, 2024

A quick run and check, I think i have found the code for the name table to be fixed:

    record(familyName,        `Glow Sans ${langStr} ${widthStr}`),
    record(subfamilyName,     weightStr),

I think you may want to update the code to be:

if (weightStr == "Regular" || weightStr == "Bold"){
    record(familyName,        `Glow Sans ${langStr} ${widthStr}`),
    record(subfamilyName,     weightStr),
} else {
    record(familyName,        `Glow Sans ${langStr} ${widthStr} ${weightStr}`),
    record(subfamilyName,     `Regular`),
}

The same fix would need to be fix across languages so maybe(?) put this code at the top for all languages:

if (weightStr == "Bold"){
    weightName1Str = "";
    weightName2Str = "Bold";
} else if (weightStr == "Regular"){
    weightName1Str = "";
    weightName2Str = "Regular";
} else {
    weightName1Str = weightStr;
    weightName2Str = "Regular";
}
...
    record(familyName,        `Glow Sans ${langStr} ${widthStr} ${weightName1Str}`),
    record(subfamilyName,     weightName2Str),

from glow-sans.

celestialphineas avatar celestialphineas commented on May 29, 2024

Thank you for pointing out the problem and working on further research. I think I've realized what is going wrong. The latest version follows the naming scheme for Macintosh (platformID=1) but actually has platformID=3 (Windows), causing unexpected behaviors on both platforms. We will differentiate the name records for different flatforms in the next version.

The working name table records for nameID = 1, 2, 4 might be,

[{
    "platformID": 1,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 1,
    "nameString": "Glow Sans SC Compressed"
},
{
    "platformID": 1,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 2,
    "nameString": "Book"
},
{
    "platformID": 1,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 4,
    "nameString": "Glow Sans SC Compressed Book"
},
{
    "platformID": 3,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 1,
    "nameString": "Glow Sans SC Compressed Book"
},
{
    "platformID": 3,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 2,
    "nameString": "Regular"
},
{
    "platformID": 3,
    "encodingID": 1,
    "languageID": 1033,
    "nameID": 4,
    "nameString": "Glow Sans SC Compressed Book"
}]

from glow-sans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.