Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts #1163

Closed
wants to merge 27 commits into from
Closed

Fonts #1163

wants to merge 27 commits into from

Commits on Oct 30, 2021

  1. Consolidate setFont().

    Improve text font support.
    Improve naming to differentiate between text fonts and music fonts (for engraving).
    Remove DEFAULT_ prefix.
    Use Font.SERIF and Font.SANS_SERIF instead of 'Times' and 'Arial'.
    Rename getFontStack().
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    aa3ee32 View commit details
    Browse the repository at this point in the history
  2. Load Roboto Slab and PetalumaScript with the FontFace API before runn…

    …ing VexFlow tests.
    
    This fixes the test case: ChordSymbol › Chord Symbol Font Size Tests › Canvas + Bravura
    
    Publish npm package vexflow-fonts (stored in tools/woff/).
    This allows the *.woff, *.woff2, and *.otf to be hosted on unpkg/jsdelivr.
    flow.html loads the web fonts directly from unpkg.
    
    Command line QUnit test now uses flow-headless-browser.html instead (it's
    much simpler).
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    b5f11c6 View commit details
    Browse the repository at this point in the history
  3. Clean up ChordSymbol.

    Improve how we handle default static TEXT_FONT.
    Factory.Annotation(params) now takes a FontInfo object.
    Note: Factory.Annotation() has a different default font than new Annotation().
    Rename this.textFont to this.textFormatter.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    4b5727d View commit details
    Browse the repository at this point in the history
  4. Add Gonville web fonts.

    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    63d84b2 View commit details
    Browse the repository at this point in the history
  5. Add an element ID to the title div of test cases on flow.html.

    This allows us to use fragment identifiers to scroll directly
    to a test case (by using the name of the PNG file generated by
    our visual regression tests).
    
    Explore loading custom fonts in node JS.
    
    Temporarily get back to zero visual diffs for the purposes of code
    review by unfixing some bugs:
    - restore inconsistent font families.
    - restore the bug in ChordSymbol + PetalumaScript.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    5bd02f3 View commit details
    Browse the repository at this point in the history
  6. Move general font methods into Font class.

    Methods remaining in TextFont deal with formatting / metrics.
    TextFont will be renamed to TextFormatter.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    accf4f2 View commit details
    Browse the repository at this point in the history
  7. Rename TextFont to TextFormatter.

    Rename TextFontTests to FontTests.
    Remove unused code.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    4422613 View commit details
    Browse the repository at this point in the history
  8. Reorganize fonts in the tools/ folder.

    Attempt to read/write OTF files. Cannot currently convert to WOFF.
    Continue to rely on FontSquirrel for now.
    Use the FontSquirrel version of PetalumaScript for better kerning.
    Add information on how to convert the OTF to WOFF via FontSquirrel.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    35ad621 View commit details
    Browse the repository at this point in the history
  9. Lazy loading of fonts only works when globalObject is not defined.

    Move OTF files. Bump vexflow-fonts. Clean up font scripts.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    2f2b341 View commit details
    Browse the repository at this point in the history
  10. Simple glyph inspector for Bravura/Petaluma.

    Update the legacy glyphs.html and transform.html.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    8ef22c5 View commit details
    Browse the repository at this point in the history
  11. Use the global font stack instead of the Element's local font stack.

    Use a precomputed string as a key for the glyph cache.
    Move new glyph inspector and legacy font tools to tools/fonts/.
    Update CHANGELOG.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    9511e46 View commit details
    Browse the repository at this point in the history
  12. Delete jQuery.

    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    ecfdd27 View commit details
    Browse the repository at this point in the history
  13. Improve API for Flow and Tables.

    Fix visual diff in textbracket_tests.ts.
    More clean up.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    3393d37 View commit details
    Browse the repository at this point in the history
  14. Improve glyph inspector.

    - Support all fonts.
    - Support both OTF and extracted outlines.
    Add more documentation.
    Other small fixes.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    e07046b View commit details
    Browse the repository at this point in the history
  15. Use FontWeight / FontStyle constants more consistently.

    Improve OTF glyph inspector (Gonville font).
    Fix demos.
    Discovered a potential API stumbling block by writing tests.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    b5cb75d View commit details
    Browse the repository at this point in the history
  16. Consolidate the setFont(...) API and handle edge cases.

    Add .font setter/getter to Element and rename internal instance member to `textFont`.
    Add test code for setFont() in tests/font_tests.ts.
    Other smaller fixes.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    79c3540 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    51c849c View commit details
    Browse the repository at this point in the history
  18. Zero visual diffs.

    Fix Gruntfile and tsconfig to emit .d.ts and support ESM.
    Improve flow.html.
    
    Review tests/* for API differences. Mark changed lines with
    "RONYEH" and revert those lines to current master where possible.
    This is only for simplifying the code review. Afterward, I will
    add a single commit re-introducing all the commented-out lines, which
    will result in small visual diffs in the output.
    
    Revert setFont(...) and .font='...' calls to current master, to
    demonstrate the 4.0 API is (mostly) backwards compatible.
    For extra robustness (and backwards compatibility), we support empty
    strings for weight & style. '' is equivalent to 'normal'.
    ronyeh committed Oct 30, 2021
    Configuration menu
    Copy the full SHA
    d6af5c3 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e1b596e View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2021

  1. Disable FontFace warnings to support distributions without the FontFace

    declarations.
    Fix eslint warnings.
    ronyeh committed Nov 1, 2021
    Configuration menu
    Copy the full SHA
    cee8ff3 View commit details
    Browse the repository at this point in the history
  2. Separate the setFont (all arguments undefined) into its own case,

    to support older TS compilers that complain about object spread with
    undefined.
    ronyeh committed Nov 1, 2021
    Configuration menu
    Copy the full SHA
    910fa34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7a50d3a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6823ab6 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2021

  1. Configuration menu
    Copy the full SHA
    bf45050 View commit details
    Browse the repository at this point in the history
  2. Partial merge of branch 'master' into setFont.

    Includes relative path imports for test files from:
    0xfe#1209
    ronyeh committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    0403e59 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2021

  1. Improve build process.

    Update demos.
    Fix capitalization.
    Fix README. eslint autofix markdown and JS.
    ronyeh committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    bbfe811 View commit details
    Browse the repository at this point in the history
  2. Fix export of Vex.

    Fix an integration issue where common.d.ts isn't exported but it
    is referenced by TS files.
    Solution: remove common.d.ts and move types to where they are actually used.
    
    Fix issues caused by renaming output files.
    ronyeh committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    ff1a9d3 View commit details
    Browse the repository at this point in the history