Giter Club home page Giter Club logo

Comments (8)

rexrainbow avatar rexrainbow commented on May 21, 2024 1

Add string parameter testString into config, to test if the font is loaded completed or not.

  1. Fill 0 within an internal canvas.
  2. Draw testString.
  3. Check if any pixel has non-zero value.

Here is a test.

from phaser3-rex-notes.

rexrainbow avatar rexrainbow commented on May 21, 2024

圖片
Here is my result of running demo in chrome(upper texts) and firefox (lower texts), the looks of font in these 2 browsers seems not the same.

But the result in anther environment looks good.
圖片

It might be a complex issue I guess. I will try to solve it later.

from phaser3-rex-notes.

ikeba avatar ikeba commented on May 21, 2024

Thanks for the answer.
To see more complex result for this specific font, you should consider using native letters, e.g.

'שלום עולם!'

I mentioned Chrome and Firefox because it is not visible at all in Firefox and it is easier to see the problem (imho).

For example,
first time:
image
and second (with cache)
image

from phaser3-rex-notes.

ikeba avatar ikeba commented on May 21, 2024

Reproduced in your test snipped also:

1st time
image

And second time
image

from phaser3-rex-notes.

rexrainbow avatar rexrainbow commented on May 21, 2024

Yes, I see that weird result. I modified test code to show 'Hello' and שלום' עולם!' .
1st time, 'Hello' will be shown, 2nd time, all words will be shown, like you said. Since 'Hello' is shown, I thought that font was loaded completed. But I have no idea why עולם!' is not shown, sorry.

from phaser3-rex-notes.

rexrainbow avatar rexrainbow commented on May 21, 2024

It seems that some parts of font is not loaded completed, i.e. trigger 'active' event (an internal event of google webfont loader) too early.
Maybe I could add a string parameter, to check if this specific string is drawn on a background text object.

from phaser3-rex-notes.

ikeba avatar ikeba commented on May 21, 2024

Wow, looks like a magic :)

from phaser3-rex-notes.

rexrainbow avatar rexrainbow commented on May 21, 2024

Issue solved.

from phaser3-rex-notes.

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.