Giter Site home page Giter Site logo

msdf-gdx-gen's People

Contributors

maltaisn avatar phu54321 avatar tommyettinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

msdf-gdx-gen's Issues

Tool doesn't generate the space char in any Font

I'm not sure why this is, but on both TTF files I've run on so far, the char with id 32 (' ') does not appear in the generated font, regardless of whether I load the list of chars from a file or use an existing name like ascii. I can manually add space, but I don't know if I have the x-advance right and I don't know if kerning should be different with a space. Here are two fonts generated with msdf-gdx-gen and unaltered since; neither has a char with id=32 (space).

Iosevka-Slab.zip
Generated with: java.exe -jar msdfgen.jar -t mtsdf -d 1024 1024 -s 16 -p 5 -c Iosevka-Slab.txt Iosevka-Slab.ttf

YanoneKaffeesatz.zip
Generated with: java.exe -jar msdfgen.jar -t mtsdf -d 1024 1024 -s 60 -p 5 -c YanoneKaffeesatz-Regular.txt YanoneKaffeesatz-Regular.ttf

If you want, I can try to submit a PR, but like I said, I'm not sure why this happens.

Parameter --texture-size doesn't work.

I believe this is due to the code trying to parse it as a list of Ints, but the library used to handle parameters says only lists of Strings are supported due to Java limitations:

https://jcommander.org/#_fixed_arities

Also, note that only List is allowed for parameters that define an arity. You will have to convert these values yourself if the parameters you need are of type Integer or other (this limitation is due to Java’s erasure).

Out of memory when converting a large charset (CJK)

I'm trying to convert a very large charset (17144 characters) with this tool. Note that I've gave 8GB already to JVM, but it still lacks memory and fails on 40% of progress.

java -Xmx8g -jar msdfgen.jar -g ./msdfgen -o output -s 16 -r 4 -c cp949.txt NotoSansCJKkr-Bold.otf

  • About -g option: I'm using macOS for I'm using a cmake-built msdfgen. (directly built from github repo).

Can this memory problem be fixed? Thanks.

cp949.txt
NotoSansCJKkr-Bold.otf.zip

Glyph placing is odd

I've noticed that using roboto-regular the glyph placing is a bit odd.

This is a sample render using the shader from msdf-gen and the texture has been generated with this utility.

image

As you can see the B is placed a bit too high as well as the l and the L. The D also looks a bit off.
The issues persists when scaling the font to any size, so my guess is that the font generation messes something up?

Concurrent modification causes an exception

Running the generator with extended charset ran into a null pointer exception.

Exception in thread "main" java.lang.NullPointerException
        at java.base/java.util.TreeMap.rotateLeft(TreeMap.java:2221)
        at java.base/java.util.TreeMap.fixAfterInsertion(TreeMap.java:2288)
        at java.base/java.util.TreeMap.put(TreeMap.java:580)
        at com.maltaisn.msdfgdx.gen.BMFont$generateGlyphs$1$1.invokeSuspend(BMFont.kt:95)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:1738)

This is most likely caused by concurrent modification, as the operation is run in a concurrent context. Replacing the sorted map with a ConcurrentSkipListMap<Char,FontGlyph>() solved the issue, but might need some more verification.

The line in question:

private val glyphs = sortedMapOf<Char, FontGlyph>()

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.