User Tools

Site Tools


guides:createafont

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guides:createafont [2023/10/05 01:53] discordguides:createafont [2023/10/10 23:54] (current) – [Recipe] discord
Line 1: Line 1:
 ====== Bake A Custom SDF Font! ====== ====== Bake A Custom SDF Font! ======
  
-So, you want to make a custom font atlas and +So, you want to make a custom font atlas for the Vulkan renderer! Here's my artisanal recipe, passed down through generations.
  
 ===== Ingredients ===== ===== Ingredients =====
Line 11: Line 11:
   * A C++ compiler   * A C++ compiler
   * Cmake   * Cmake
-  * tinyxml2 (install using your package manager, it's ''tinyxml2'' on brew)+  * tinyxml2 (install using your package manager, it's ''tinyxml2'' on in Homebrew (''%%brew%%''))
  
 ===== Recipe ===== ===== Recipe =====
Line 22: Line 22:
 make & cd bin # build and go to the output folder make & cd bin # build and go to the output folder
 </file> </file>
-  - Generate font files! \\ <file bash>+  - Generate font files! <file bash>
 # the magic command # the magic command
 ./msdf-atlas-gen -type mtsdf -format png -csv FONTNAME.csv -imageout FONTNAME.png -font PATH_TO_FONT_FILE ./msdf-atlas-gen -type mtsdf -format png -csv FONTNAME.csv -imageout FONTNAME.png -font PATH_TO_FONT_FILE
 </file> </file>
   - Copy the generated ''FONTNAME.csv'' and ''FONTNAME.png'' to the ''vendor/fonts'' folder in folk   - Copy the generated ''FONTNAME.csv'' and ''FONTNAME.png'' to the ''vendor/fonts'' folder in folk
-  - Edit line this line in ''display.folk'' \\<file tcl>+  - Edit line the lines that look like this line in ''display.folk'' to set it as a default <file tcl>
 # replace the "PTSans-Regular" with FONTNAME # replace the "PTSans-Regular" with FONTNAME
-variable font [font load "PTSans-Regular"]+[...] {font "PTSans-Regular"} [...] 
 +</file> 
 +  - To use it in programs, do so: <file tcl> 
 +# using a wish 
 +Wish $this is labelled "Text" with font "FONTNAME" 
 +# using display 
 +Display::text $x $y $scale $text $radians FONTNAME
 </file> </file>
guides/createafont.1696470798.txt.gz · Last modified: 2023/10/05 01:53 by discord

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki