├── .gitignore ├── README.md ├── VEFontCache.pur ├── assets ├── fontstash_open_pull_requests.png └── typeface_anatomy.png ├── fontstash.pur └── fontstash_forks.md /.gitignore: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Text Rendering Notes 2 | 3 | ## Significant Repos 4 | 5 | [fontstash](https://github.com/memononen/fontstash) 6 | Supported by sokol: [sokol/util/sokol_fontstash.h](https://github.com/floooh/sokol/blob/master/util/sokol_fontstash.h) 7 | There are several forks for fonstash... Going to elabroate on them in a separate [file](fontstash_forks.md) 8 | 9 | [ColleagueRiley/RFont](https://github.com/ColleagueRiley/RFont) 10 | Claims to target better perforamnce than fontstash. 11 | Decided to directly intergrate stb_truetype.h instead of keeping it separate (There is an option to define `RFONT_EXTERNAL_STB`). 12 | 13 | [jtsiomb/libdrawtext](https://github.com/jtsiomb/libdrawtext) 14 | 15 | [kevinmkchin/vertext](https://github.com/kevinmkchin/vertext) 16 | 17 | [hypernewbie/VEFontCache](https://github.com/hypernewbie/VEFontCache) 18 | (Also looks very good..., but it uses c++, easy to port however since its 1691 lines...) 19 | 20 | * [Ed94/VEFontCache-Odin](https://github.com/Ed94/VEFontCache-Odin): Ended up porting & overhauled this to Odin-lang 21 | 22 | [fontdue](https://github.com/mooman219/fontdue) 23 | (Self-proclaimed "fastest rasterizer") 24 | 25 | ## Industry standard (free if you negotiate use on a free purpose, porting interface to X-Lang is problably non-trivial) 26 | 27 | [slug](https://sluglibrary.com) 28 | 29 | ## Learning Resources 30 | 31 | [npx-imx/gtec-demo-frameowrk/Doc/FslSimpleUI](https://github.com/nxp-imx/gtec-demo-framework/blob/master/Doc/FslSimpleUI.md) 32 | 33 | [Implementing a Font Reader and Rasterizer from Scratch, Part 1: TTF Font Reader](https://handmade.network/forums/articles/t/7330-implementing_a_font_reader_and_rasterizer_from_scratch%252C_part_1__ttf_font_reader) 34 | 35 | [LearnOpenGL - Text Rendering](https://learnopengl.com/In-Practice/Text-Rendering) 36 | [Improving Learn OpenGL's Text Rendering Example | Adventures in Coding](https://youtu.be/S0PyZKX4lyI) 37 | [Repo for above vod: johnWRS/LearnOpenGLTextRenderingImprovement](https://github.com/johnWRS/LearnOpenGLTextRenderingImprovement) 38 | 39 | [GPU Gems 3: Chapter 25. Rendering Vector Art on the GPU](https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-effects/chapter-25-rendering-vector-art-gpu) 40 | 41 | [Writing a TrueType font renderer](https://axleos.com/writing-a-truetype-font-renderer/) 42 | 43 | [Wikibooks/OpenGL_Programming/... Text Rendering 01](https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_01) 44 | [02 of above](https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02) 45 | 46 | [Simple good quality subpixel text rendering in OpenGL with stb_truetype and dual source blending](http://arkanis.de/weblog/2023-08-14-simple-good-quality-subpixel-text-rendering-in-opengl-with-stb-truetype-and-dual-source-blending) 47 | 48 | ## Examples 49 | 50 | [Immediate-Mode-UI/Nuklear/nuklear_font.c](https://github.com/Immediate-Mode-UI/Nuklear/blob/master/src/nuklear_font.c) 51 | [raddebugger (non-trivial to digest solution)](https://github.com/Ed94/raddebugger) 52 | [refterm](https://www.youtube.com/playlist?list=PLEMXAbCVnmY6zCgpCFlgggRkrp0tpWfrn) 53 | [ocornut/imgui/imgui_draw.cpp#L4006](https://github.com/ocornut/imgui/blob/master/imgui_draw.cpp#L4006) 54 | [4coder-archive/4coder](https://github.com/4coder-archive/4coder.git) 55 | [gl-4.5-subpixel-text-rendering](https://github.com/arkanis/gl-4.5-subpixel-text-rendering/tree/17f4af4df858c52092ccad7c4292e7e4cd08091b) 56 | 57 | ## Font Parsers 58 | 59 | [freetype](https://freetype.org) 60 | [englerj/odin-freetype](https://github.com/englerj/odin-freetype.git) 61 | [stb/stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) 62 | [odin-lang/Odin/vendor/stb/truetype/stb_truetype.odin](https://github.com/odin-lang/Odin/blob/master/vendor/stb/truetype/stb_truetype.odin) 63 | [harfbuzz/ttf-parser (rust)](https://github.com/harfbuzz/ttf-parser) 64 | 65 | [MSDN - True Type](https://learn.microsoft.com/en-us/typography/truetype/) 66 | [MSDN - OpenType Specification](https://learn.microsoft.com/en-us/typography/opentype/spec/) 67 | 68 | [khaledhosny/ots - OpenType Sanitizer](https://github.com/khaledhosny/ots) 69 | 70 | ## Text Shapers 71 | 72 | [harfbuzz](https://github.com/harfbuzz/harfbuzz) 73 | [hamza](https://github.com/saidwho12/hamza) 74 | [Fribidi](https://github.com/fribidi/fribidi) 75 | 76 | ## GPU Related 77 | 78 | [Efficient 2D Signed Distance Field Generation on GPU](https://astiopin.github.io/2019/01/06/sdf-on-gpu.html) 79 | 80 | * [demo of above - astiopin/sdf_atlas](https://github.com/astiopin/sdf_atlas) 81 | 82 | [GreenLighting/gpu-font-rendering](https://github.com/GreenLightning/gpu-font-rendering) 83 | 84 | [evanw/theta](https://github.com/evanw/theta) 85 | [Related article for theta's implementation](https://medium.com/@evanwallace/easy-scalable-text-rendering-on-the-gpu-c3f4d782c5ac) 86 | 87 | [MSDFGL - OpenGL-accelerated implementation of the multi-channel signed distance-field algorithm.](https://github.com/nyyManni/msdfgl) 88 | 89 | [andrewlowndes/perfect-antialiasing: Antialiasing via conservative rasterisation and analytical area computation](https://github.com/andrewlowndes/perfect-antialiasing) 90 | 91 | [GPU Gems 2: Chapter 42. Conservative Rasterization](https://developer.nvidia.com/gpugems/gpugems2/part-v-image-oriented-computing/chapter-42-conservative-rasterization) 92 | 93 | * [Conservative Rasterization and Raster Order Views](https://ubm-twvideo01.s3.amazonaws.com/o1/vault/gdc2017/Presentations/Sathe_Rahul_RasterOrderViews.pdf) 94 | 95 | ### Vector Path Accelerators 96 | 97 | [NV Path Rendering](https://developer.nvidia.com/nv-path-rendering-videos) 98 | [OpenVG](https://www.khronos.org/openvg/) 99 | 100 | [ajstarks/openvg](https://github.com/ajstarks/openvg) 101 | 102 | [ShivaVG: open-source ANSI C OpenVG](https://ivanleben.blogspot.com/2007/07/shivavg-open-source-ansi-c-openvg.html) 103 | [ileben/ShivaVG](https://github.com/ileben/ShivaVG) 104 | 105 | [amanithvg](https://www.amanithvg.com) 106 | 107 | ## Papers 108 | 109 | [SIGGRAPH2007: Improved Alpha-Tested Magnification for Vector Textures and Special Effects](https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf) 110 | [Resolution Independent Curve Rendering using Programmable Graphics Hardware](https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/p1000-loop.pdf) 111 | [Higher Quality 2D Text Rendering](https://jcgt.org/published/0002/01/04/) 112 | [Wavelet Rasterization](https://people.engr.tamu.edu/schaefer/research/wavelet_rasterization.pdf) 113 | 114 | ## Misc 115 | 116 | ### Metafont (Historical) 117 | 118 | [Wikipedia](https://en.wikipedia.org/wiki/Metafont) 119 | [metaflop/metaflop-www](https://github.com/metaflop/metaflop-www) 120 | [Metapost](https://tug.org/metapost.html) 121 | 122 | ### Forking Paths 123 | 124 | [A Vector Graphics Renderer — part 1](https://forkingpaths.dev/posts/17-12-16/vector_graphics_p1.html) 125 | [A Vector Graphics Renderer — part 2](https://forkingpaths.dev/posts/17-12-21/vector_graphics_p2.html) 126 | [A Vector Graphics Renderer — part 3](https://forkingpaths.dev/posts/18-01-14/vector_graphics_p3.html) 127 | [Revisiting Vector Graphics on the GPU](https://forkingpaths.dev/posts/22-11-01/vector_graphics.html) 128 | [Orca Vector Graphics Backend](https://orca-app.dev/posts/240426/vector_graphics.html) 129 | 130 | ### Mr. 4th Programming 131 | 132 | [Graphics 2[7] Baking Optimized Fonts Data](https://youtu.be/PQ-wJVjR4MU?list=PLT6InxK-XQvPYA_HLUozeyPGTjwcvYsBj) 133 | [Graphics [8]: Low Level Rendering API Part 1](https://youtu.be/C8gm9l4OJ9o?list=PLT6InxK-XQvPYA_HLUozeyPGTjwcvYsBj) 134 | [Graphics [9]: Low Level Rendering API Part 2](https://youtu.be/Na7pKMupsew?list=PLT6InxK-XQvPYA_HLUozeyPGTjwcvYsBj) 135 | [Graphics [10]: High Level Rendering API](https://youtu.be/jDUTWPEFvY0?list=PLT6InxK-XQvPYA_HLUozeyPGTjwcvYsBj) 136 | ... 137 | 138 | ### Tscoding 139 | 140 | [ded editor](https://github.com/tsoding/ded) 141 | [Legendary Font Rendering](https://youtu.be/_t3mtjoHuoQ) 142 | [Rendering Text Editor on GPU](https://youtu.be/srV_l795O_s) 143 | 144 | [OpenGL Text Rendering for My Immediate UI Library - Offline Stream #02](https://youtu.be/mq3UXqPmBE8) 145 | 146 | ## Conceptual Overview for Typography 147 | 148 | [Google Fonts: Typeface](https://fonts.google.com/knowledge/glossary/typeface) 149 | 150 | [Wikipeida - Outline](https://en.wikipedia.org/wiki/Template:Typography) 151 | 152 | [Wikipedia - Anatomy](https://en.wikipedia.org/wiki/Typeface_anatomy) 153 | ![Anatomy img](./assets/typeface_anatomy.png) 154 | 155 | [Sociology of Fonts - Defining the Terms Part 1: Anatomy](https://www.societyoffonts.com/2017/04/11/defining-the-termspart-1-anatomy/) 156 | [Sociology of Fonts - Defining the Terms Part 2: Process](https://www.societyoffonts.com/2017/04/18/defining-the-termspart-2-process/) 157 | [Sociology of Fonts - Defining the Terms Part 3: Categorization](https://www.societyoffonts.com/2017/04/25/defining-the-termspart-3-categorization/) 158 | 159 | ## Original Notes Header 160 | 161 | The goal here was to find some solution that was small and preferrably interopped well with [odin-lang](https://odin-lang.org). 162 | So, everything that was either not written in C or was not going to be an easy port, was ignored. 163 | 164 | Now I just keep this in sync with anything I find while working on my fork of VEFontCache. 165 | 166 | ### Interesting... 167 | 168 | [MacType](https://github.com/snowie2000/mactype) 169 | -------------------------------------------------------------------------------- /VEFontCache.pur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ed94/TextRendering_Notes/55218f245e3a355344952f0b522f82115a7ed0e8/VEFontCache.pur -------------------------------------------------------------------------------- /assets/fontstash_open_pull_requests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ed94/TextRendering_Notes/55218f245e3a355344952f0b522f82115a7ed0e8/assets/fontstash_open_pull_requests.png -------------------------------------------------------------------------------- /assets/typeface_anatomy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ed94/TextRendering_Notes/55218f245e3a355344952f0b522f82115a7ed0e8/assets/typeface_anatomy.png -------------------------------------------------------------------------------- /fontstash.pur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ed94/TextRendering_Notes/55218f245e3a355344952f0b522f82115a7ed0e8/fontstash.pur -------------------------------------------------------------------------------- /fontstash_forks.md: -------------------------------------------------------------------------------- 1 | # fontstash forks 2 | 3 | These are in chronological order. 4 | Mostly focusing on stuff that doesn't look already merged in 5 | 6 | ## Aktau 7 | 8 | [aktau/fontstash](https://github.com/aktau/fontstash) 9 | 10 | Oldest (non-merged in) fork, has various changes nothing immediately notable... 11 | 12 | Stopped: 2013 13 | 14 | ## nyorem 15 | 16 | [nyorem/fontstash](https://github.com/nyorem/fontstash) 17 | 18 | Seems to have C++ code but not dependent on it. 19 | 20 | Changes: 21 | 22 | * Bitmap font support 23 | * Truetype font loading from memory 24 | * Added ability to load an arbitrary number of fonts (not just four) 25 | * Use multiple OpenGL textures for glyph caching (not just one) 26 | 27 | Stopped: 2016 28 | 29 | ## starseeker 30 | 31 | [starseeker/fontstash](https://github.com/starseeker/fontstash) 32 | 33 | Various updates (old updates) to stb_truetype ver, manually merges in changes from BastiaanOlij(Bastian Olij) & Zammalad(Pil Sampson). 34 | 35 | Stopped: 2017 36 | 37 | ### BastiaanOij 38 | 39 | OpenGL 3 support, shadowed by starseeker's. 40 | 41 | Stopped: 2016 42 | 43 | ## kthwaite 44 | 45 | C++, ignoring 46 | 47 | Stopped: 2017 48 | 49 | ## wheybags 50 | 51 | [wheybags/fontstash](https://github.com/wheybags/fontstash) 52 | 53 | Add SDF font support. Merged into suikki's (which stopped in 2018) 54 | 55 | Stopped: 2017 56 | 57 | ## oov 58 | 59 | [oov/fontstash](https://github.com/oov/fontstash/commits/master/) 60 | 61 | Added ability to delete fonts 62 | 63 | Stopped: 2018 64 | 65 | ## jimon 66 | 67 | [jimon/fontstash](https://github.com/jimon/fontstash/tree/dmytro/bitmap_icons) 68 | 69 | Custom font engine upport 70 | 71 | Stopped: 2018 72 | 73 | --- 74 | 75 | ## All forks from here on are forked from the last commit from the original author 76 | 77 | Everything not merged in: 78 | 79 | ![open_pull_reqeusts](assets/fontstash_open_pull_requests.png) 80 | 81 | 82 | ## toyboot4e 83 | 84 | Rust related, ignoring. 85 | 86 | ## relick 87 | 88 | [relick/fontstash](https://github.com/relick/fontstash) 89 | 90 | Memory leak & warning fixes. 91 | 92 | Stopped: 2021 93 | 94 | ## Beyley 95 | 96 | [Beley/fontstash](https://github.com/Beyley/fontstash) 97 | 98 | Seems to be for zig, makes it a 'standalone compiled library'. 99 | 100 | Stopped: 2023 101 | 102 | ## ColleagueRiley 103 | 104 | [CollegeRiley/fontstash](https://github.com/ColleagueRiley/fontstash) 105 | 106 | Got rid of VLAs, peformance fixes. Seems to have abandoned it in favor of rolling their own solution: [RFont](https://github.com/ColleagueRiley/RFont) 107 | 108 | Stopped: 2023 109 | 110 | --- 111 | 112 | All other updates were not significant. 113 | --------------------------------------------------------------------------------