├── README.md ├── example-webgl ├── font_arial.png └── index.html ├── index.html └── todo.md /README.md: -------------------------------------------------------------------------------- 1 | # Font Texture Generator 2 | 3 | This app is hosted at https://evanw.github.io/font-texture-generator/. 4 | -------------------------------------------------------------------------------- /example-webgl/font_arial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evanw/font-texture-generator/d7e9b16111eddf1833116c19d487ae1a6d55127d/example-webgl/font_arial.png -------------------------------------------------------------------------------- /example-webgl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |38 | This example demonstrates using a font texture that was automatically generated by https://evanw.github.io/font-texture-generator/. 39 | The demo below uses signed distance fields to keep text nicely anti-aliased at all scale factors. 40 | Rendering is done in pure WebGL code without any dependencies. 41 |
42 | 43 | 44 | 153 | 354 |355 | The texture used in this example looks like this: 356 |
357 |80 | This is a simple utility for generating font textures. 81 | See this example for one way of using the generated font texture. 82 | This code is licensed under the CC0 license and lives at https://github.com/evanw/font-texture-generator. 83 | Distance fields are computed using jump flooding for speed with 2x supersampling for quality. 84 | The generator is unicode-aware and even supports emoji. 85 |
86 |Font name: | 89 |90 | 91 | 92 | 96 | 100 | | 101 |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Font size: | 104 |105 | | ||||||||||||
Resolution: | 108 |109 | 113 | 117 | | 118 |||||||||||||
Data format: | 121 |122 | 126 | 130 | 134 | | 135 |||||||||||||
Characters: | 138 |139 | 143 | 147 | 148 | | 149 |||||||||||||
Display type: | 152 |
153 |
157 |
161 |
162 |
203 | 163 |
204 |
208 | 205 | Falloff: 206 | 207 | |
209 |
212 | 213 | 214 | 215 |
216 | 217 | 1172 | 1173 | 1174 | -------------------------------------------------------------------------------- /todo.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | * Detect and fix Chrome's gamma curve to alpha (for font sizes <= 256px) 4 | * Smoother distance fields through better edge distance estimates 5 | * Add a mode to space glyphs evenly in a grid for monospace fonts 6 | * Experiment with extracting kerning values from HTML element widths 7 | --------------------------------------------------------------------------------