[{"data":1,"prerenderedAt":748},["ShallowReactive",2],{"navigation_docs":3,"-shaders-font-images":271,"-shaders-font-images-surround":743},[4,35,70,120,154,183,217,246,261],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Getting started","\u002Fgetting-started","1.getting-started",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"What is ISF Studio","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":15,"path":16,"stem":17,"icon":18},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Your first shader","\u002Fgetting-started\u002Ffirst-shader","1.getting-started\u002F3.first-shader","i-lucide-code-2",{"title":25,"path":26,"stem":27,"icon":28},"Your first pipeline","\u002Fgetting-started\u002Ffirst-pipeline","1.getting-started\u002F4.first-pipeline","i-lucide-workflow",{"title":30,"path":31,"stem":32,"icon":33},"Interface tour","\u002Fgetting-started\u002Finterface-tour","1.getting-started\u002F5.interface-tour","i-lucide-layout-panel-left",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Library","\u002Flibrary","2.library",[40,45,50,55,60,65],{"title":41,"path":42,"stem":43,"icon":44},"The explorer","\u002Flibrary\u002Fexplorer","2.library\u002F1.explorer","i-lucide-folder-tree",{"title":46,"path":47,"stem":48,"icon":49},"Organizing files","\u002Flibrary\u002Forganizing-files","2.library\u002F2.organizing-files","i-lucide-files",{"title":51,"path":52,"stem":53,"icon":54},"Images and gallery","\u002Flibrary\u002Fimages-and-gallery","2.library\u002F3.images-and-gallery","i-lucide-image",{"title":56,"path":57,"stem":58,"icon":59},"Sharing","\u002Flibrary\u002Fsharing","2.library\u002F4.sharing","i-lucide-package",{"title":61,"path":62,"stem":63,"icon":64},"Installing in software","\u002Flibrary\u002Finstalling-in-software","2.library\u002F5.installing-in-software","i-lucide-folder-input",{"title":66,"path":67,"stem":68,"icon":69},"OpenFX plug-ins","\u002Flibrary\u002Fopenfx-plugins","2.library\u002F6.openfx-plugins","i-lucide-plug",{"title":71,"path":72,"stem":73,"children":74,"page":34},"Shaders","\u002Fshaders","3.shaders",[75,80,85,90,95,100,105,110,115],{"title":76,"path":77,"stem":78,"icon":79},"The code editor","\u002Fshaders\u002Fcode-editor","3.shaders\u002F1.code-editor","i-lucide-square-code",{"title":81,"path":82,"stem":83,"icon":84},"The ISF header","\u002Fshaders\u002Fisf-header","3.shaders\u002F2.isf-header","i-lucide-braces",{"title":86,"path":87,"stem":88,"icon":89},"The preview","\u002Fshaders\u002Fpreview","3.shaders\u002F3.preview","i-lucide-monitor-play",{"title":91,"path":92,"stem":93,"icon":94},"Input controls","\u002Fshaders\u002Finput-controls","3.shaders\u002F4.input-controls","i-lucide-sliders-horizontal",{"title":96,"path":97,"stem":98,"icon":99},"Presets","\u002Fshaders\u002Fpresets","3.shaders\u002F5.presets","i-lucide-bookmark",{"title":101,"path":102,"stem":103,"icon":104},"Console and fixes","\u002Fshaders\u002Fconsole","3.shaders\u002F6.console","i-lucide-terminal",{"title":106,"path":107,"stem":108,"icon":109},"Shader templates","\u002Fshaders\u002Ftemplates","3.shaders\u002F7.templates","i-lucide-layout-template",{"title":111,"path":112,"stem":113,"icon":114},"Vertex shaders","\u002Fshaders\u002Fvertex-shaders","3.shaders\u002F8.vertex-shaders","i-lucide-shapes",{"title":116,"path":117,"stem":118,"icon":119},"Font images","\u002Fshaders\u002Ffont-images","3.shaders\u002F9.font-images","i-lucide-type",{"title":121,"path":122,"stem":123,"children":124,"page":34},"Pipelines","\u002Fpipelines","4.pipelines",[125,129,134,139,144,149],{"title":126,"path":127,"stem":128,"icon":28},"Concepts","\u002Fpipelines\u002Fconcepts","4.pipelines\u002F1.concepts",{"title":130,"path":131,"stem":132,"icon":133},"Editing a graph","\u002Fpipelines\u002Fediting-graphs","4.pipelines\u002F2.editing-graphs","i-lucide-mouse-pointer-click",{"title":135,"path":136,"stem":137,"icon":138},"Node catalog","\u002Fpipelines\u002Fnode-catalog","4.pipelines\u002F3.node-catalog","i-lucide-boxes",{"title":140,"path":141,"stem":142,"icon":143},"Toolbox and snippets","\u002Fpipelines\u002Fsnippets-and-toolbox","4.pipelines\u002F4.snippets-and-toolbox","i-lucide-toolbox",{"title":145,"path":146,"stem":147,"icon":148},"Composing","\u002Fpipelines\u002Fcomposing","4.pipelines\u002F5.composing","i-lucide-combine",{"title":150,"path":151,"stem":152,"icon":153},"Macros","\u002Fpipelines\u002Fmacros","4.pipelines\u002F6.macros","i-lucide-package-plus",{"title":155,"path":156,"stem":157,"children":158,"page":34},"Media and inputs","\u002Fmedia","5.media",[159,164,168,173,178],{"title":160,"path":161,"stem":162,"icon":163},"Resources","\u002Fmedia\u002Fresources","5.media\u002F1.resources","i-lucide-clapperboard",{"title":165,"path":166,"stem":167,"icon":163},"Export a video","\u002Fmedia\u002Fvideo-export","5.media\u002F2.video-export",{"title":169,"path":170,"stem":171,"icon":172},"Videos and sounds","\u002Fmedia\u002Fvideos-and-sounds","5.media\u002F3.videos-and-sounds","i-lucide-audio-lines",{"title":174,"path":175,"stem":176,"icon":177},"MIDI","\u002Fmedia\u002Fmidi","5.media\u002F4.midi","i-lucide-sliders-vertical",{"title":179,"path":180,"stem":181,"icon":182},"OSC","\u002Fmedia\u002Fosc","5.media\u002F5.osc","i-lucide-radio-tower",{"title":184,"path":185,"stem":186,"children":187,"page":34},"Workspace","\u002Fworkspace","6.workspace",[188,193,198,203,208,213],{"title":189,"path":190,"stem":191,"icon":192},"Tabs and layout","\u002Fworkspace\u002Ftabs-and-layout","6.workspace\u002F1.tabs-and-layout","i-lucide-columns-2",{"title":194,"path":195,"stem":196,"icon":197},"History and clipboard","\u002Fworkspace\u002Fhistory-and-clipboard","6.workspace\u002F2.history-and-clipboard","i-lucide-history",{"title":199,"path":200,"stem":201,"icon":202},"Saving and drafts","\u002Fworkspace\u002Fsaving","6.workspace\u002F3.saving","i-lucide-save",{"title":204,"path":205,"stem":206,"icon":207},"Shortcuts","\u002Fworkspace\u002Fshortcuts","6.workspace\u002F4.shortcuts","i-lucide-keyboard",{"title":209,"path":210,"stem":211,"icon":212},"Preferences","\u002Fworkspace\u002Fpreferences","6.workspace\u002F5.preferences","i-lucide-settings",{"title":56,"path":214,"stem":215,"icon":216},"\u002Fworkspace\u002Fsharing","6.workspace\u002F6.sharing","i-lucide-share-2",{"title":218,"path":219,"stem":220,"children":221,"page":34},"Reference","\u002Freference","7.reference",[222,226,231,236,241],{"title":223,"path":224,"stem":225,"icon":84},"ISF header","\u002Freference\u002Fisf-header-reference","7.reference\u002F1.isf-header-reference",{"title":227,"path":228,"stem":229,"icon":230},"File formats","\u002Freference\u002Ffile-formats","7.reference\u002F2.file-formats","i-lucide-file-archive",{"title":232,"path":233,"stem":234,"icon":235},"Troubleshooting","\u002Freference\u002Ftroubleshooting","7.reference\u002F3.troubleshooting","i-lucide-life-buoy",{"title":237,"path":238,"stem":239,"icon":240},"ISF specifications","\u002Freference\u002Fisf-specifications","7.reference\u002F4.isf-specifications","i-lucide-book-marked",{"title":242,"path":243,"stem":244,"icon":245},"Pipeline text","\u002Freference\u002Fpipeline-text","7.reference\u002F5.pipeline-text","i-lucide-bot-message-square",{"title":247,"path":248,"stem":249,"children":250,"page":34},"For developers","\u002Fruntime","8.runtime",[251,256],{"title":252,"path":253,"stem":254,"icon":255},"Playing pipelines and shaders","\u002Fruntime\u002Fplaying-pipelines","8.runtime\u002F1.playing-pipelines","i-lucide-play",{"title":257,"path":258,"stem":259,"icon":260},"Listening to sound","\u002Fruntime\u002Flistening-to-sound","8.runtime\u002F2.listening-to-sound","i-lucide-audio-waveform",{"title":262,"path":263,"stem":264,"children":265,"page":34},"Licensing","\u002Flicensing","9.licensing",[266],{"title":267,"path":268,"stem":269,"icon":270},"Pricing","\u002Flicensing\u002Fpricing","9.licensing\u002F1.pricing","i-lucide-badge-euro",{"id":272,"title":116,"body":273,"description":736,"extension":737,"links":738,"meta":739,"navigation":740,"path":117,"seo":741,"stem":118,"__hash__":742},"docs\u002F3.shaders\u002F9.font-images.md",{"type":274,"value":275,"toc":725},"minimark",[276,294,302,307,378,385,389,393,407,484,494,498,542,558,574,579,616,682,702,706],[277,278,279,280,284,285,288,289,293],"p",{},"A shader has no fonts. ",[281,282,283],"strong",{},"Font Image"," turns a font into a picture: a grid of multi-channel distance fields, one cell for each character, that a shader reads from an ",[281,286,287],{},"Imported"," image to draw text at any size, sharp. What a shader needs to lay the text out (the width of each character, its line height) is written in the image itself, so the image is all you carry around: it works in the preview, in a pipeline, in a video export and in an ",[290,291,292],"a",{"href":67},"OpenFX plug-in",".",[295,296,297,298,301],"note",{},"Font Image is a ",[281,299,300],{},"Pro"," feature.",[303,304,306],"h2",{"id":305},"make-the-image","Make the image",[308,309,310,326,342,356,363],"ol",{},[311,312,313,314,317,318,321,322,325],"li",{},"Open a library, then choose ",[281,315,316],{},"File, New, Font Image…"," (or ",[281,319,320],{},"New…, Font Image…"," in the context menu of the explorer, or ",[281,323,324],{},"Font Image…"," on a font file).",[311,327,328,329,332,333,337,338,341],{},"Choose a font of the computer, or ",[281,330,331],{},"Choose a file…"," for a ",[334,335,336],"code",{},".ttf"," or ",[334,339,340],{},".otf"," font.",[311,343,344,345,348,349,352,353,293],{},"Choose the ",[281,346,347],{},"characters"," (an image holds 256 consecutive characters: the first page is the Latin alphabet), the ",[281,350,351],{},"cell"," (the size of a character in the image) and the ",[281,354,355],{},"range",[311,357,358,359,362],{},"Optionally, type a ",[281,360,361],{},"text"," and a name for it: the dialog then also makes the small image that holds that text, and gives the code that draws it.",[311,364,365,366,369,370,373,374,377],{},"Press ",[281,367,368],{},"Create",". The images are written in the folder that was in front in the explorer (the one you right-clicked, the one of the font file, the library itself when none), which you can change in the ",[281,371,372],{},"Folder"," field. The explorer opens it, and ",[281,375,376],{},"Show the image"," opens the picture.",[277,379,380,381,384],{},"A larger cell is sharper when the text is drawn big, and makes a larger image. The ",[281,382,383],{},"Wide"," range gives the effects (outline, glow, shadow) more room around the letters.",[386,387,388],"warning",{},"The image is a copy of the outlines of the font. Check that the license of the font allows it, above all if you deliver the result (a plug-in, a video). The dialog tells when a font says that it cannot be embedded.",[303,390,392],{"id":391},"read-it-in-a-shader","Read it in a shader",[277,394,395,396,398,399,402,403,406],{},"Add the image as an ",[281,397,287],{}," input (",[281,400,401],{},"+","), then use the snippets of the ",[281,404,405],{},"Text & sprites"," family:",[408,409,410,423],"table",{},[411,412,413],"thead",{},[414,415,416,420],"tr",{},[417,418,419],"th",{},"Snippet",[417,421,422],{},"What it gives",[424,425,426,437,447,461,474],"tbody",{},[414,427,428,434],{},[429,430,431],"td",{},[281,432,433],{},"Font Char",[429,435,436],{},"How much of a pixel a character covers, from 0 to 1.",[414,438,439,444],{},[429,440,441],{},[281,442,443],{},"Font Text",[429,445,446],{},"The same for a whole text held in a text image, up to 256 characters. A line break goes to the next line.",[414,448,449,458],{},[429,450,451,454,455],{},[281,452,453],{},"Font Char Distance",", ",[281,456,457],{},"Font Text Distance",[429,459,460],{},"The signed distance in pixels to the letters, for outlines and glows.",[414,462,463,471],{},[429,464,465,454,468],{},[281,466,467],{},"Font Advance",[281,469,470],{},"Font Line Height",[429,472,473],{},"The metrics of the font, to lay text out yourself.",[414,475,476,481],{},[429,477,478],{},[281,479,480],{},"Sprite Cell",[429,482,483],{},"The cell of a sprite sheet, for any grid of pictures.",[277,485,486,487,489,490,493],{},"The text reaches the shader in one of two ways: as ",[281,488,334],{}," that the dialog gives (the text is written in a comment above it), or in a small ",[281,491,492],{},"text image",", one pixel for each character, that you can swap without touching the shader.",[303,495,497],{"id":496},"draw-text-in-a-pipeline","Draw text in a pipeline",[277,499,500,501,504,505,508,509,511,512,515,516,518,519,522,523,526,527,530,531,533,534,537,538,541],{},"In a pipeline, the ",[281,502,503],{},"Text"," category has a ",[281,506,507],{},"Draw Text"," node. It takes the string that is wired to its ",[334,510,361],{}," input, and draws it with the font image wired to ",[334,513,514],{},"font"," (an imported image): ",[334,517,277],{}," is the pixel in pixels from the start of the first line, ",[334,520,521],{},"size"," the em in pixels, ",[334,524,525],{},"spacing"," and ",[334,528,529],{},"lineSpacing"," what is added to each character and to each line, as a fraction of ",[334,532,521],{}," (0, the default, is the font's own: 0.1 opens the characters a little, a negative number closes them), ",[334,535,536],{},"result"," the coverage from 0 to 1 and ",[334,539,540],{},"sdf"," the signed distance in pixels, for outlines and glows.",[277,543,544,526,547,550,551,553,554,557],{},[334,545,546],{},"aabbMin",[334,548,549],{},"aabbMax"," give the box of the text, in the same pixels as ",[334,552,277],{}," (from the start of the first line, ",[334,555,556],{},"y"," upwards): from the start of the lines to the end of the longest one, and from the descender of the last line to the ascender of the first. It is the box of the lines, not of the ink: spaces count, and every glyph is measured by its advance. Use it to centre or align a text, or to draw a background behind it.",[277,559,560,561,454,563,337,566,569,570,573],{},"The string comes from a ",[281,562,503],{},[281,564,565],{},"Comment",[281,567,568],{},"TODO"," node of the same category: each has a string output. Write the text in the node, wire it to Draw Text. The text is written in the shader as code, one call for each character, so the shader has no string and no extra image to carry: it is the ",[571,572,443],"em",{}," snippets' unrolled form. A text holds up to 256 characters, and a line break goes to the next line. A string cannot cross the edge of a group, a loop or a function: keep Text and Draw Text in the same graph.",[575,576,578],"h3",{"id":577},"type-a-text-one-character-at-a-time","Type a text, one character at a time",[277,580,581,582,585,586,454,588,454,590,526,592,594,595,597,598,601,602,605,606,609,610,612,613,615],{},"The ",[281,583,584],{},"Typewriter"," node (same category) takes the same string, the same font image and the same ",[334,587,277],{},[334,589,521],{},[334,591,525],{},[334,593,529],{}," as ",[281,596,507],{},", and says ",[281,599,600],{},"how much of the text is written"," at a given time: ",[334,603,604],{},"time"," is the seconds since it starts and ",[334,607,608],{},"speed"," the characters a second. Its ",[334,611,536],{}," is 1 where the text is written and 0 elsewhere, with an edge one pixel wide at the pen: multiply it by the ",[334,614,536],{}," of Draw Text. It adds up the width of each character, with the font, as Draw Text places them, so the edge always falls between two letters, whatever the font. A line break counts as a character; the lines before the one being written are all there.",[277,617,618,619,621,622,625,626,628,629,632,633,635,636,639,640,642,643,646,647,649,650,652,653,655,656,659,660,663,664,667,668,670,671,673,674,677,678,681],{},"It also gives ",[334,620,347],{},", the length of the text, and ",[334,623,624],{},"penEnd",", where the pen ends, in the same pixels as ",[334,627,277],{},". ",[334,630,631],{},"index"," is the number of the character under the pixel (-1 where there is none) and ",[334,634,351],{}," where the pixel lies in its cell: ",[334,637,638],{},"x"," from 0 to 1 across its advance, ",[334,641,556],{}," in em above the baseline. They give ",[281,644,645],{},"each letter a time of its own",": take the clock of the typewriter away by ",[334,648,631],{}," and each letter starts after the one before. With ",[334,651,351],{}," round the middle of the letter, and the ",[334,654,540],{}," of Draw Text (positive inside: pass its opposite), the ",[281,657,658],{},"Draw On"," snippet traces the outline of each letter by turning round it, then fills it, and ",[281,661,662],{},"Staggered Progress"," gives each letter its own time (the ",[281,665,666],{},"Titles - Trace"," example of ISF Studio does it). To type a second text, maybe in another font, after the first: take ",[334,669,624],{}," away from ",[334,672,277],{}," for the second Draw Text and the second Typewriter, and start the clock of the second late by ",[334,675,676],{},"characters \u002F speed",". To make it start again, wrap the time (",[334,679,680],{},"mod",") by the length of the loop you want.",[277,683,684,685,688,689,454,692,526,695,628,698,701],{},"For a text held in an ",[281,686,687],{},"image"," (made by the Font Image tool) the snippets do the same: ",[281,690,691],{},"Font Text Length",[281,693,694],{},"Typewriter Count",[281,696,697],{},"Font Text Typed",[281,699,700],{},"Soft Wipe"," is the other way to write a text on: a mask with a soft edge that goes along a width, whatever the text and the font.",[303,703,705],{"id":704},"limits","Limits",[707,708,709,719,722],"ul",{},[311,710,711,712,715,716,718],{},"The distance is exact within ",[281,713,714],{},"half the range"," on each side of the edge of a letter; further, it only says \"outside\". A wide effect needs the ",[281,717,383],{}," range.",[311,720,721],{},"An image holds 256 characters. For another alphabet, make another image and choose its characters.",[311,723,724],{},"A text image holds up to 256 characters.",{"title":726,"searchDepth":727,"depth":727,"links":728},"",2,[729,730,731,735],{"id":305,"depth":727,"text":306},{"id":391,"depth":727,"text":392},{"id":496,"depth":727,"text":497,"children":732},[733],{"id":577,"depth":734,"text":578},3,{"id":704,"depth":727,"text":705},"Turn a font into an image that any shader can read, and draw text in a shader, in the studio and in an OpenFX plug-in.","md",null,{},{"icon":119,"title":116},{"title":116,"description":736},"nq-krl8H-NAs2HzCXFOvsK8bTkUUwbPG23cR2dOfZaI",[744,746],{"title":111,"path":112,"stem":113,"description":745,"icon":114,"children":-1},"A vertex shader beside a fragment shader: how the two are paired, shown, edited and shared.",{"title":126,"path":127,"stem":128,"description":747,"icon":28,"children":-1},"Nodes, ports, and the ISF shader a pipeline compiles to.",1796047426773]