Giter Club home page Giter Club logo

Comments (4)

mooman219 avatar mooman219 commented on June 3, 2024

oh god zpix has 22,000 glyphs. I'll look into those issues thanks!

For reference, 12pt is 16px. It looks like those fonts use a recommend size in points, but fontdue consumes pixels. 1 px = .75 pt. I think RustType uses points as well. I don't have a good reason to be using pixels other than convenience right now though.

from fontdue.

mooman219 avatar mooman219 commented on June 3, 2024

As for the lines, it is unfortunate. The issue is rounding errors with single precision floats and I'm looking into ways to fix it. I have a TODO for this in code right now here.

I can render it correctly, but it introduces errors at higher sizes right now due to precision loss.
image

from fontdue.

mooman219 avatar mooman219 commented on June 3, 2024

I pushed a change to resolve this here c4bd8a0.

image

from fontdue.

TakWolf avatar TakWolf commented on June 3, 2024
    /// Retrieves the layout metrics and rasterized bitmap for the given character. If the caracter
    /// isn't present in the font, then the layout and bitmap for the font's default character is
    /// returned instead.
    pub fn rasterize(&self, character: char, px: f32) -> (Metrics, Vec<u8>) {
        self.rasterize_indexed(self.lookup_glyph_index(character), px)
    }

So this function's param px is pixel, but not point?
The right way to use fontdue rasterize is use pixel?

The Zpix font recommend size unit is actually pixel.
image
Fontdue rasterized Zpix in 12px is great! It retained the hard border so make the pixel style.

Opposite rusttype can not rasterized Zpix in 12px as well (looks like linear filter?). That's why I gave up on it. I have making the pixel style game, so there is a way to make text as pixel style is very important.

For the game develope, use pixel unit is more convenient for me.

from fontdue.

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.