0

I am getting these warnings in my custom built OpenType font.

WARNING: name: name records are not sorted.
WARNING: name: name records are not sorted.

My names are sorted like this:

nameRecords.sort(function(a, b) {
    return ((a.platformID - b.platformID) ||
            (a.encodingID - b.encodingID) ||
            (a.languageID - b.languageID) ||
            (a.nameID - b.nameID))
})

For some reason that's not actually resulting in sorting for the name records, which should be sorted by platformID, then by encodingID, then languageID, then finally nameID.

Wondering how to write the proper sorting function (in JavaScript) for the nameRecords array.

1 Answer 1

1

You need to compare first field first, if first fields are equal then compare second and so on.

Detailed description with example here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.