3b / 3b-bmfont Goto Github PK
View Code? Open in Web Editor NEWread/write bmfont metadata files
read/write bmfont metadata files
Add missing accessors for font/glyph properties, and get rid of plists
bmfont metadata supports using each channel as a separate atlas, with flags indicating which channel or channels contain a particular char.
when using the text layout function, need some way to tell where a text cursor should be
jsown reads numbers as rationals, which is somewhat annoying since we usually want floats for performance, and also allows for DOS by putting huge exponents in the data.
Need to watch performance in general though, since font metadata can get fairly large (have at least 4 files over 400k from testing sdf atlases, largest over 800k).
bmfont doesn't seem to store ascent/descent values, so try to calculate them from character bounds + y-offset etc.
SDF fonts will be more complicated since they will include extra space for the distance field, but possibly can correct for that with the extra distance-range field for sdf fonts?
Possibly add an extension to format to store them explicitly, along with adding it to sdf code and/or a tool to calculate them by actually rendering glyphs and finding bounds, if we can't reliably calculate directly from metadata?
Haven't had the time to debug this, but this is what I noticed.
when mixing fonts, might need to have multiple chunks of text adjacent to each other, so pass initial x,y coords to map-glyphs
, and return final x,y from it?
need some way to map from pixel coordinates back to position in string, for mouse interaction etc.
need some way to get bounding region of a line of text for highlights and backgrounds
possibly need options for converting to top-left or bottom-left UV origin, and options for doing layout with both options
bmfont metadata supports multiple texture atlases, so pass it to caller in case there are more than 1
blur/glow/drop shadows/etc probably need larger geometry than is provided by default, so add option to expand it.
Possibly also add some accessors for max blur radius (depends on SDF range settings when atlas was generated, which we might not know depending on metadata files?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.