Comments (3)
I don't think it will be useless, so I'm in.
BTW, does the GPU also require even width? I know some GPU likes 32-bit aligned addresses, but never heard about even numbers.
It would be nice to cover more cases, so I'd like more info how the GPU uses font textures.
from fontbm.
I don't think it will be useless, so I'm in.
Cool. I'll make some time to work on that.
BTW, does the GPU also require even width?
It does not.
I know some GPU likes 32-bit aligned addresses, but never heard about even numbers. It would be nice to cover more cases, so I'd like more info how the GPU uses font textures.
The GPU we are experimenting with is from the FTDI EVE series. They are quite constrained: just 1 MB of texture memory and an 8 KB display list. Both of those constraints are relevant to the even alignment support. To minimize the texture memory used by fonts, we store them as 4-bit gray pixels, so each byte contains two pixels. To draw the glyphs, we use the BITMAP_SOURCE
command, which takes the starting address of the bitmap, along with the BITMAP_SIZE
command to define the width and height of the bitmap to draw. When the glyph has an odd x offset, the starting address of the bitmap is one pixel (4 bits) before the start of the glyph. To render it correctly, we set a clip using the SCISSOR_*
commands (and eventually restore the clip) to exclude the that pixel. The scissor commands use more of the limited display list, which in turn limits how many glyphs can be rendered on a single screen.
I admit it is a strange case, but it is very cool that fontbm makes it so straightforward to make optimal use of the very limited display list (in addition to fontbm providing the smallest glyph atlas size we've seen from any tool, which saves texture memory too!)
For completeness, I should mention that the GPU has another way of storing fonts, basically as a vertical column of constant size glyphs. Less display list memory is required render these, but it is a very inefficient use of texture memory. We don't have plans to use this approach.
from fontbm.
Closing this issue as the PR to implement it has been merged. (Thank you!)
from fontbm.
Related Issues (20)
- feature request, solid round stroke color HOT 1
- Fonts generated by FontBM differ from their BMFont equivalents in size HOT 5
- Glyph quality? HOT 4
- How to turn off smoothing? HOT 1
- Feature Request: Dynamic height HOT 9
- Crash when character has an glyph index but the glyph cannot be loaded HOT 5
- unexpectedly large kerning table HOT 2
- adding some new features HOT 2
- Horizontal scaling factor is wrong when image cropped. HOT 1
- Feature suggestion - output outlines HOT 2
- kerning-pairs not available in current release build HOT 4
- fontsize value is negative HOT 3
- Whether the chnl value can be set? HOT 1
- Request: Compiled Version HOT 1
- Some kerning missing HOT 3
- TTF embedded bitmaps handled incorrectly HOT 2
- Italic or bold option HOT 1
- Wrong baseline? HOT 7
- Mac version? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontbm.