• This generally works fine… ??
    When adding Miltonian .woff from https://google-webfonts-helper.herokuapp.com/fonts/miltonian?subsets=latin
    into a new fontset the font name (mandatory) isn’t auto populated and then I can’t reference the font via javascript
    Thanks

    jQuery(document).ready(function( $ ){
        $("body").on("fontsampler.event.activatefont", ".fontsampler-wrapper", function (myevent) {
        console.log  ($(myevent.target).find(".font-lister option:selected").val()) // the index of the selected option
        console.log ($(myevent.target).find(".font-lister option:selected").html()) // the displayed name of the selected option
                  });

    get

    fontsampler.js?ver=5.7:116 Uncaught TypeError: Cannot convert undefined or null to object
        at Function.keys (<anonymous>)
        at n.r._updateFeatureControls (fontsampler.js?ver=5.7:116)
        at n.r._onActivateFont (fontsampler.js?ver=5.7:116)
        at e.t.publish (fontsampler.js?ver=5.7:114)
        at t.n._selectFont (fontsampler.js?ver=5.7:116)
        at r (fontsampler.js?ver=5.7:117)
        at HTMLSelectElement.onChange (fontsampler.js?ver=5.7:117)
        at Object.triggerCallback (fontsampler.js?ver=5.7:117)
        at a.change (fontsampler.js?ver=5.7:117)
        at a.select (fontsampler.js?ver=5.7:117)
    r._updateFeatureControls @ fontsampler.js?ver=5.7:116
    r._onActivateFont @ fontsampler.js?ver=5.7:116
    t.publish @ fontsampler.js?ver=5.7:114
    n._selectFont @ fontsampler.js?ver=5.7:116
    r @ fontsampler.js?ver=5.7:117
    onChange @ fontsampler.js?ver=5.7:117
    triggerCallback @ fontsampler.js?ver=5.7:117
    change @ fontsampler.js?ver=5.7:117
    select @ fontsampler.js?ver=5.7:117
    click @ fontsampler.js?ver=5.7:117
    dispatch @ jquery.min.js?ver=3.5.1:2
    v.handle @ jquery.min.js?ver=3.5.1:2
    • This topic was modified 3 years, 8 months ago by farlington.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author kontur

    (@kontur)

    Hm,

    the auto-populated name is just a “suggestion” — you can type a name there youself, no?

    If you somehow managed to save it without a name that would result in problems when accessing the font later, yes.

    Cheers,
    Johannes

    Thread Starter farlington

    (@farlington)

    I think it’s a problem with the miltonian file since all other fonts I use work fine.
    I created a quick mock up site (available for 7 days only!) with just the above JScript to print to the console and and a text fontsampler with two fonts (arimo: works, miltonian: errors). NB I gave miltonian a name when added to fontsampler.
    https://mammoth-sea.jurassic.ninja/sample-page/
    User: demo, password: UQKQqeIvqB8F

    Thanks for any more advice

    Plugin Author kontur

    (@kontur)

    Hey,

    thanks for the test page. It looks like the font has no Opentype features at all, and I think somewhere in the code when updating the list of detected features there is an assumption that all fonts would have such features which causes a problem in the Javascript.

    I’ll have to investigate this some more, but that you for the test case.

    Thread Starter farlington

    (@farlington)

    Thanks Johannes,
    It would be great if this could be fixed in a future Fontsampler release.
    Thanks again

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘One specific font won’t load name into a new fontset’ is closed to new replies.