Giter VIP home page Giter VIP logo

msdf-c's People

Contributors

solenum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

msdf-c's Issues

Large amounts of "whitespace" around lowercase glyphs

I've noticed that msdf-c generates some glyphs, mostly lower-case glyphs, with more space around the main character data than msdfgen provides.

Here are some examples. Glyphs generated from Roboto Regular at 32x32, a range of 1, and with autoframe.

Chars: a, @, h, c, -

Chlumsky/msdfgen:
image
image
image
image
image

exezin/msdf-c:
image
image
image
image
image

256x256 Example:
image
image

Underflow in uint8_t conversion

I noticed the SDF images people were posting in issues seemed really broken, so I tried it out myself and sure enough got the same result. I was wondering how come the non-SDF output image was still OK, and I noticed that when you transfer msdf to bitmap_sdf, you convert negative values to unsigned integers (uint8_t).

Bad Good
bad good

Improving the quality of small text

Hey,
I'm using an almost identical version of main.c but with the following changes:

  char fontdefault[] = "hiragino-kaku-gothic-pron-w3.otf";
  int size_sdf = 50;
  int size_bitmap = 14;

  char *c     = "ใ‚";
  char *out   = "out.png";
  char *fontf = fontdefault;

The result is pretty blurry:
msdf_out
out

I tried setting size_sdf to smaller values like 14 but the quality is still not too great:
msdf_out
out

Perhaps I'm doing something wrong. How can I improve the result?

bug in msdf.c line 910

in msdf.c, line 910:
edge_segment_t *parts[3] = {};
edge_split(&contour_data[i].edges[0], parts[0], parts[1], parts[2]);

parts[3] are wild pointers.

fix:
edge_segment_t parts[3] = {0};
edge_split(&contour_data[i].edges[0], &parts[0], &parts[1], &parts[2]);

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.