Text - Maple Help

ImageTools[Draw]

 Text
 ImageTools:-Draw Text Primitive

 Calling Sequence Text( image, x, y, text, position, font, font_size, rotation, degrees, color, weight, stretch, constrain )

Parameters

 image - ImageTools:-Image x - numeric y - numeric text - string position - (optional) identical("N","S","E","W","NE","SE","NW","SW","") := "" font - (optional) integer := 13 (roman duplex) font_size - (optional) {numeric, [numeric,numeric]} := 12.0 rotation - (optional) numeric := 0.0 degrees - (optional) truefalse := false color - (optional) see description weight - (optional) numeric := 1.0 stretch - (optional) {numeric, [numeric,numeric]} := 0 (no stretching) constrain - (optional) {numeric, [numeric,numeric]} := 0 (no constraint)

Description

 • Images can be annotated with text using the Text primitive. The text produced is based on the Hershey vector fonts, first published by Dr. Allen V. Hershey in 1967. These fonts are platform and resolution independent, and are rendered by ImageTools:-Draw using anti-aliasing. They can be rotated, and scaled independently in width and height. In addition to the usual ASCII characters, the Hershey fonts contain Greek and Cyrillic glyphs, a subset of Japanese characters, and a large collection of symbols.
 • After first creating an image using ImageTools:-Create, or loading an image with ImageTools:-Read, drawing operations can be performed on it using a number of primitives (functions that draw one kind of object). The first argument to each primitive is the image itself, as returned by Create or Read.
 • The x and y arguments specify an anchor point for the text to be rendered,
 • The position argument specifies where the text will appear relative to the anchor point. The position can be specified as a 1 or 2-character string, or an ImageTools:-Draw exported symbol as defined in the following table:

 "" CENTER Geometric center of the text will coincide with the anchor point. "N" NORTH Text will appear above the anchor point. "S" SOUTH Text will appear below the anchor point. "E" EAST Text will appear to the right of the anchor point. "W" WEST Text will appear to the left of the anchor point. "NE" NORTHEAST Text will appear above and to the right of the anchor point. "SE" SOUTHEAST Text will appear below and to the right of the anchor point. "NW" NORTHWEST Text will appear above and to the left of the anchor point. "SW" SOUTHWEST Text will appear below and to the left of the anchor point. "B" BASELINE Geometric center of the text's baseline will coincide with the anchor point. "BE" BASELINE_EAST Text will appear to the left of the anchor point, with the baseline passing through the anchor point. "BW" BASELINE_WEST Text will appear to the right of the anchor point, with the baseline passing through the anchor point.

 • The font argument specifies which of the Hershey fonts to use. This is specified by number, but ImageTools:-Draw exports several symbolic names that can also be used.
 0 - CYRILLIC_COMPLEX or CYRILLIC
 1 - GOTHIC_ENGLISH_TRIPLEX or GOTHIC
 2 - GOTHIC_GERMAN_TRIPLEX or GERMAN
 3 - GOTHIC_ITALIAN_TRIPLEX or ITALIAN
 4 - GREEK_COMPLEX or GREEK
 5 - GREEK_COMPLEX_SMALL
 6 - GREEK_PLAIN
 7 - GREEK_SIMPLEX
 8 - ITALIC_COMPLEX or ITALIC
 9 - ITALIC_COMPLEX_SMALL
 10 - ITALIC_TRIPLEX
 11 - ROMAN_COMPLEX or ROMAN or SERIF
 12 - ROMAN_COMPLEX_SMALL
 13 - ROMAN_DUPLEX or SANS_SERIF
 14 - ROMAN_PLAIN
 15 - ROMAN_SIMPLEX
 16 - ROMAN_TRIPLEX
 17 - SCRIPT_COMPLEX or SCRIPT
 18 - SCRIPT_SIMPLEX
 The fonts with symbols ending in SMALL were optimized for rendering at smaller sizes, and therefore have lower spatial resolution (fewer control points, spaced closer together) in the original Hershey fonts. In Maple, they are scaled to be the same relative size as all the other fonts, but are a good choice when rending in small sizes.
 • The font_size argument, if given as a single numeric values, specifies the height, in pixels, of the capital letter "X". The size can also be specified as a list of two values, in which case the second value specifies the height. The first value specifies the width, not of a specific glyph, but relative to the second value. For example, font_size=[15,20] specifies than an "X" will be 20 pixels high, and that all glyphs should be scaled to 3/4 of their natural width at the specified height.

 • Text can be rotated using the rotation argument. Rotations are specified in radians (unless the degrees is true), and proceed counter-clockwise from the positive x-axis. The rotation is performed around the anchor point as implied by the position argument. In the example below, the anchor point is in the center of the image, and position is "E":
 • The degrees argument specifies if the rotation is in degrees or radians. If degrees is false (i.e. degrees=false is passed, which is the default), the rotation argument must be in radians. If degrees is true (degrees=true or just degrees), the rotation argument must be in degrees. This argument can be specified only as a keyword argument.
 • The color argument specifies the color of the text and can be specified in one of several forms:

 gray A numeric value between 0 and 1 specifying a shade of gray. The value 0 corresponds to black, and 1 to white. [r,g,b] A list of three numeric values between 0 and 1 specifying the red, green, and blue components separately. [r,g,b,α] A list of four numeric values between 0 and 1 specifying the red, green, blue, and opacity (alpha) separately. When the opacity is less than 1, the color will be blended with the existing content of the image. A value of type ColorTools:-Color. ColorTools:-Color argument(s) Any form accepted by the ColorTools:-Color constructor, such as a string giving a color name (e.g. "red", palette and color name (e.g. "Niagara DarkOrchid"), or palette and color number (e.g. "Nautical 1"). Two argument forms are accepted as well, but then it is necessary to always use the keyword form of the color argument, since otherwise the two arguments will be interpreted as two separate arguments to the drawing primitive. For example, color=("HSV",[0.5,0.6,0.6]).

 • The default line weight can be modified via the weight argument of the Text primitive. The value of this argument is interpreted as a multiplier for the default weight. Weights in the range of 1.2 to 1.8 will typically result in the glyphs becoming completely filled in. Weights that are too heavy will result in a blurring effect:
 The Hershey fonts were originally designed to be rendered on a vector device, such as an oscilloscope display or pen plotter. As such, the concept of line weight was never incorporated into the original design, as this would depend entirely on the characteristics of the device. ImageTools:-Draw chooses a default line weight (i.e. thickness) based on the font and font_size to replicate the appearance on a typical vector device.
 • The effect of the weight argument, and how the default is affected by font_size can be seen in this image:

 • The stretch or constrain arguments can be used to fit text to a specified width and/or height. Each argument accepts either a single numeric value specifying both the width and height, or a list of two values specifying width and height respectively.
 If the stretch argument is used, the text is stretched or compressed as necessary to fit into the desired space. The result will be text that exactly fills the specified width and/or height. If either the width or height is given as zero, that dimension of the text remains unaffected.
 • The constrain argument is similar to stretch, except that the text is never enlarged. If it already fits a dimension, its size in that dimension is not altered. Furthermore, if both width and height are constraints are given, the text is scaled the same amount in both dimensions to satisfy the tighter constraint. Its aspect ratio does not change.
 • The Text primitive returns a pair of values giving the font size that was actually used. If neither the stretch nor constrain arguments were passed, then these sizes will be the same as the font_size that was passed (or the default if none was given).
 • The options beginning with position are best provided as keyword equations, but can also be provided as positional arguments starting in the 5th position as declared in the calling sequence above.  Only the degrees option must be passed as a keyword argument if used.

Fine Control of Spacing (Manual Kerning)

 • Each glyph in the Hershey fonts has its own defined bounding box. When the characters are rendered, the bounding boxes are placed adjacent to one another. Although this produces acceptable output for most applications, it is sometimes desirable to increase or decrease the inter-character spacing to be more aesthetically pleasing. The Text primitive understands two special characters, backspace (entered into a string as "\b") and tab ("\t"), which respectively remove or insert one half of the current thickness of line used to render the characters.

 The second line in the image above was created by passing the string, "A\b\bC\bT\tIV\b\b\b\bA\b\bT\tIO\bN T\b\b\b\by\b\bp\be\b\bw\b\br\t\titer" to the Text primitive.

Changing Font Mid-text

 • Usually, an entire string is rendered by the Text primitive using a single font. It is possible to change fonts in the middle of a string by including a formfeed character (entered into a string as "\f"), followed by one or two digits specifying the new font number (if a digit is to appear immediately after changing to a single-digit font, simply include a leading zero before the font number).
 • For example, the string "Embedded \f8italic\f11 and \f17script\f11 text" will render like this (assuming font 11 was specified as the font argument initially):

Greek and Cyrillic Alphabets

 • Because of the close correspondence between the Latin alphabet, and the Greek and Cyrillic alphabets, the Text primitive will map Latin characters to Greek or Cyrillic characters when the appropriate font is selected. The following image shows the mapping, with the Latin (ASCII) character on the left, and the corresponding Greek or Cyrillic character on the right.
 Mapping of Latin to Greek characters:

 Mapping of Latin to Cyrillic characters:

 • These mappings allow many, but far from all, Greek or Cyrillic words to be specified using the English transliteration (not translation) of the word. For example, the first line of the image below was generated from the string, "Vostok, Pilot = \f0Vostok, Pilot", whereas the second line required "Archimedes = \f4Arximhdhw":
 An example of Latin to Cyrillic and Greek mapping:

 • Notice also that there is an accent missing on the first η, as the Text primitive currently has no way to indicate accented characters (although the accent marks do exist as separate glyphs).

Symbols

 • The Hershey font set contains a large number of glyphs for special symbols that are not part of the usually 7-bit ASCII character set. The Text primitive lets you include these symbols within a string by inserting an escape character (entered into a string as "\e"), followed by a series of up to four digits giving the glyph number (if a digit is to appear immediately after a symbol whose glyph number is less than four digits, simply include enough leading zeros to pad the number out to four digits).
 • Note that the glyph numbers do not correspond to Unicode symbol numbers (a mechanism to accept Unicode strings is planned for a future version of ImageTools:-Draw).

 • Images showing all of the glyphs, including those of the ordinary ASCII characters in the various supported fonts, are reproduced below:
 • All supported alphanumeric and symbol glyphs (1 of 2). Click to view full size (1427×2262 pixels):

 • All supported alphanumeric and symbol glyphs (2 of 2). Click to view full size (1427×2276 pixels):

Japanese Characters

 • In addition to the symbols described above, the font set contains a very small subset of Japanese characters (758 in total, including some that are obsolete). These are used in the same way as the symbols, by inserting an escape character and the four-digit number of the glyph.

Package Usage

 • This function is part of the ImageTools:-Draw package, so it can be used in the short form Text(..) only after executing the command with(ImageTools:-Draw). However, it can always be accessed through the long form of the command by using ImageTools:-Draw:-Text(..).

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{with}\left(\mathrm{ImageTools}:-\mathrm{Draw}\right):$

Collage of text samples.

 > $\mathrm{img}≔\mathrm{Create}\left(240,320,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},5,235,"Text Samples",\mathrm{position}="SE",\mathrm{font}=16,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}="maroon"\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,145,"Roman Plain",\mathrm{position}="E",\mathrm{font}=14,\mathrm{font_size}=20,\mathrm{weight}=1.2,\mathrm{color}=\left[0,0.5,0\right],\mathrm{rotation}=15,\mathrm{degrees}\right):$
 > $\mathrm{Text}\left(\mathrm{img},5,110,"Italic Triplex",\mathrm{position}="E",\mathrm{font}=10,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}=\left[0,0.5,0.5\right]\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,80,"Script Complex",\mathrm{position}="E",\mathrm{font}=17,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}="blue",\mathrm{rotation}=-\frac{\mathrm{\pi }}{12}\right):$
 > $\mathrm{Text}\left(\mathrm{img},310,120,"Vertical Text",\mathrm{position}="N",\mathrm{font}=1,\mathrm{font_size}=25,\mathrm{color}=\left[0.5,0,0.5\right],\mathrm{rotation}=90,\mathrm{degrees}\right):$
 > $\mathrm{Text}\left(\mathrm{img},270,135,"Kirillica",\mathrm{position}="N",\mathrm{font}=0,\mathrm{font_size}=20,\mathrm{color}=\left[0.25,0.25,0.25\right],\mathrm{rotation}=\frac{\mathrm{\pi }}{2}\right):$
 > $\mathrm{Text}\left(\mathrm{img},5,5,"WIDE",\mathrm{position}="NE",\mathrm{font}=11,\mathrm{font_size}=\left[45,20\right],\mathrm{weight}=1.2,\mathrm{color}=\left[0.5,0.5,0\right]\right):$
 > $\mathrm{Text}\left(\mathrm{img},195,5,"NARROW",\mathrm{position}="NE",\mathrm{font}=11,\mathrm{font_size}=\left[10,20\right],\mathrm{weight}=1.5,\mathrm{color}=\left[0.75,0.5,0\right]\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Sample of each font 10.

 > $\mathrm{img}≔\mathrm{Create}\left(35,320,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},5,17,"ABCD abcd 0123 &?*",\mathrm{position}="E",\mathrm{font}=10,\mathrm{font_size}=17,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

The font_size argument.

 > $\mathrm{img}≔\mathrm{Create}\left(120,400,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,100,"font_size=20",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,60,"font_size=\left[14,20\right]",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=\left[14,20\right],\mathrm{weight}=1.5,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,20,"font_size=\left[28,20\right]",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=\left[28,20\right],\mathrm{weight}=1.5,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

The rotation argument.

 > $\mathrm{img}≔\mathrm{Create}\left(400,400,\mathrm{channels}=3,\mathrm{background}=\left[0.1,0.1,0.1\right]\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}r\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{by}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}30\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}359\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},200,200,\mathrm{sprintf}\left("--rotation=%3d\e718",r\right),\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=15,\mathrm{weight}=1.10,\mathrm{rotation}=r,\mathrm{degrees}=\mathrm{true},\mathrm{color}=\left("HSV",\left[\frac{r}{360},1,1\right]\right)\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Effect of the weight argument with different font sizes.

 > $\mathrm{img}≔\mathrm{Create}\left(380,620,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,360,"font_size=12",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=12,\mathrm{weight}=1.5,\mathrm{color}="blue"\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,336,"font_size=20",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}="blue"\right):$
 > $\mathrm{Text}\left(\mathrm{img},12,290,"weight=1.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=12,\mathrm{weight}=1.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},12,210,"weight=1.5",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=12,\mathrm{weight}=1.5,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},12,130,"weight=2.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=12,\mathrm{weight}=2.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},12,50,"weight=3.3",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=12,\mathrm{weight}=3.3,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,260,"weight=1.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=1.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,180,"weight=1.5",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=1.5,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,100,"weight=2.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=2.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,20,"weight=3.3",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=20,\mathrm{weight}=3.3,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},255,350,"font_size=40",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=\left[30,40\right],\mathrm{weight}=1.5,\mathrm{color}="blue"\right):$
 > $\mathrm{Text}\left(\mathrm{img},255,280,"weight=1.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=40,\mathrm{weight}=1.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},255,200,"weight=1.5",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=40,\mathrm{weight}=1.10,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},255,120,"weight=2.0",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=40,\mathrm{weight}=2.0,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},255,40,"weight=3.3",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=40,\mathrm{weight}=3.3,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Using the stretch argument.

 > $\mathrm{wL},\mathrm{hL},\mathrm{xOff},\mathrm{yOff}≔240,60,50,30:$
 > $\mathrm{fntSz}≔\frac{\mathrm{wL}}{13}:$
 > $\mathrm{wR},\mathrm{hR}≔330,\mathrm{floor}\left(\mathrm{fntSz}\cdot 0.9\right):$
 > $\mathrm{img}≔\mathrm{Create}\left(4\mathrm{hL}+5\mathrm{yOff},\mathrm{wL}+\mathrm{wR}+3\mathrm{xOff},\mathrm{channels}=3,\mathrm{background}=0.5\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{cw}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[0,1\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{ch}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[0,1\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}r≔\left(1-\mathrm{cw}\right)\cdot 2+\left(1-\mathrm{ch}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔\mathrm{xOff};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}y≔r\left(\mathrm{yOff}+\mathrm{hL}\right)+\mathrm{yOff};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{SolidRectangle}\left(\mathrm{img},x,y,x+\mathrm{wL},y+\mathrm{hL},\mathrm{color}=\left[0.75,0,0\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+\frac{\mathrm{wL}}{2},y+\frac{\mathrm{hL}}{2},\mathrm{sprintf}\left("stretch=\left[%03d,%03d\right]",\mathrm{wL}\mathrm{cw},\mathrm{hL}\mathrm{ch}\right),\mathrm{position}="*",\mathrm{font}=16,\mathrm{font_size}=\mathrm{fntSz},\mathrm{color}=1,\mathrm{stretch}=\left[\mathrm{wL}\mathrm{cw},\mathrm{hL}\mathrm{ch}\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔\mathrm{xOff}\cdot 2+\mathrm{wL};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}y≔y+\frac{\mathrm{hL}-\mathrm{hR}}{2};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{SolidRectangle}\left(\mathrm{img},x,y,x+\mathrm{wR},y+\mathrm{hR},\mathrm{color}=\left[0.75,0,0\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+\frac{\mathrm{wR}}{2},y+\frac{\mathrm{hR}}{2},\mathrm{sprintf}\left("stretch=\left[%03d,%03d\right]",\mathrm{wR}\mathrm{cw},\mathrm{hR}\mathrm{ch}\right),\mathrm{position}="*",\mathrm{font}=16,\mathrm{font_size}=\mathrm{fntSz},\mathrm{color}=1,\mathrm{stretch}=\left[\mathrm{wR}\mathrm{cw},\mathrm{hR}\mathrm{ch}\right]\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Using the constrain argument.

 > $\mathrm{wL},\mathrm{hL},\mathrm{xOff},\mathrm{yOff}≔240,60,50,30:$
 > $\mathrm{fntSz}≔\frac{\mathrm{wL}}{13}:$
 > $\mathrm{wR},\mathrm{hR}≔330,\mathrm{floor}\left(\mathrm{fntSz}\cdot 0.9\right):$
 > $\mathrm{img}≔\mathrm{Create}\left(4\mathrm{hL}+5\mathrm{yOff},\mathrm{wL}+\mathrm{wR}+3\mathrm{xOff},\mathrm{channels}=3,\mathrm{background}=0.5\right):$
 > $r≔3:$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{cw}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[0,1\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{ch}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[0,1\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}r≔\left(1-\mathrm{cw}\right)\cdot 2+\left(1-\mathrm{ch}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔\mathrm{xOff};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}y≔r\left(\mathrm{yOff}+\mathrm{hL}\right)+\mathrm{yOff};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{SolidRectangle}\left(\mathrm{img},x,y,x+\mathrm{wL},y+\mathrm{hL},\mathrm{color}=\left[0.75,0,0\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+\frac{\mathrm{wL}}{2},y+\frac{\mathrm{hL}}{2},\mathrm{sprintf}\left("constrain=\left[%03d,%03d\right]",\mathrm{wL}\mathrm{cw},\mathrm{hL}\mathrm{ch}\right),\mathrm{position}="*",\mathrm{font}=16,\mathrm{font_size}=\mathrm{fntSz},\mathrm{color}=1,\mathrm{constrain}=\left[\mathrm{wL}\mathrm{cw},\mathrm{hL}\mathrm{ch}\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔\mathrm{xOff}\cdot 2+\mathrm{wL};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}y≔y+\frac{\mathrm{hL}-\mathrm{hR}}{2};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{SolidRectangle}\left(\mathrm{img},x,y,x+\mathrm{wR},y+\mathrm{hR},\mathrm{color}=\left[0.75,0,0\right]\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+\frac{\mathrm{wR}}{2},y+\frac{\mathrm{hR}}{2},\mathrm{sprintf}\left("constrain=\left[%03d,%03d\right]",\mathrm{wR}\mathrm{cw},\mathrm{hR}\mathrm{ch}\right),\mathrm{position}="*",\mathrm{font}=16,\mathrm{font_size}=\mathrm{fntSz},\mathrm{color}=1,\mathrm{constrain}=\left[\mathrm{wR}\mathrm{cw},\mathrm{hR}\mathrm{ch}\right]\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Manual kerning using b and t.

 > $\mathrm{img}≔\mathrm{Create}\left(105,420,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,75,"ACTIVATION Typewriter",\mathrm{position}="E",\mathrm{font}=13,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,25,"A\b\bC\bT\tIV\b\b\b\bA\b\bT\tIO\bN T\b\b\b\by\b\bp\be\b\bw\b\br\t\titer",\mathrm{position}="E",\mathrm{font}=13,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Changing font mid-text using f.

 > $\mathrm{img}≔\mathrm{Create}\left(55,600,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,25,"Embedded \f8italic\f11 and \f17script\f11 text",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Generate the charts mapping Latin to Greek and Cyrillic characters.

 > $w,h≔720,\mathrm{round}\left(\frac{w\cdot 8}{11}\right):$
 > $\mathrm{rs},\mathrm{cs}≔\mathrm{round}\left(\frac{h}{13}\right),\mathrm{round}\left(\frac{w}{9}\right):$
 > $\mathrm{fntSz}≔\frac{h}{33.33}:$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}L\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[\left[0,"cy-map"\right],\left[4,"gr-map"\right]\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{img}≔\mathrm{Create}\left(h,w,3,\mathrm{background}=\mathrm{white}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}r\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}11\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}c\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}0\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}7\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{ch}≔\mathrm{convert}\left(\left[r\cdot 8+c+32\right],\mathrm{bytes}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},\left(c+1\right)\mathrm{cs},h-\left(r+1\right)\mathrm{rs},\mathrm{sprintf}\left("%s=\f%02d%s",\mathrm{ch},L\left[1\right],\mathrm{ch}\right),\mathrm{position}="*",\mathrm{font}=13,\mathrm{font_size}=\mathrm{fntSz},\mathrm{color}=0\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}L\left[2\right]="cy-map"\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{imgC}≔\mathrm{img}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{else}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{imgG}≔\mathrm{img}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 > $\mathrm{Embed}\left(\mathrm{imgC}\right)$

 > $\mathrm{Embed}\left(\mathrm{imgG}\right)$

A sample of some of the available non-ASCII glyphs.

 > $\mathrm{img}≔\mathrm{Create}\left(200,450,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,175,"Math: \e1411 \e2268 \e2269 \e2265 \e2266 \e2270 ...",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,125,"Zodiac: \e2301 \e2302 \e2303 \e2304 \e2305 ...",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,75,"Music: \e2324 \e2325 \e2330 \e2381 \e2378 ...",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,25,"Weather: \e764 \e765 \e766 \e767 \e768 ...",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Generate the charts of (1) Japanese characters and (2) all other glyphs.

 > $\mathrm{glyphW}≔67:$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{chart}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left[\left[\mathrm{round}\left(21.3\mathrm{glyphW}\right),"jp",4000,4757\right],\left[\mathrm{round}\left(21.3\mathrm{glyphW}\right),"sy1",1,2200\right],\left[\mathrm{round}\left(21.3\mathrm{glyphW}\right),"sy2",2201,3926\right]\right]\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}w,\mathrm{file},\mathrm{lo},\mathrm{hi}≔\mathrm{op}\left(\mathrm{chart}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}h≔\mathrm{round}\left(w\cdot 1.7\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x,y≔\frac{\mathrm{glyphW}}{4},10;\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{img}≔\mathrm{Create}\left(h,w,3,\mathrm{background}=\mathrm{white}\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dymax}≔0;\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}n\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{lo}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{hi}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}s≔\mathrm{sprintf}\left("\e%d",n\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dx},\mathrm{dy}≔\mathrm{TextSize}\left(\mathrm{img},s,\mathrm{font}=14,\mathrm{font_size}=12,\mathrm{weight}=1.2\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dx},\mathrm{dy}≔\mathrm{dx}-1,\mathrm{dy}-1;\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left(\mathrm{dx},\mathrm{dy}\right)\ne \left(0.,0.\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+5,h-y,\mathrm{sprintf}\left("%d",n\right),\mathrm{position}="SE",\mathrm{font}=14,\mathrm{font_size}=10,\mathrm{color}="red",\mathrm{weight}=1.2\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{Text}\left(\mathrm{img},x+5,h-y-17,s,\mathrm{position}="SE",\mathrm{font}=14,\mathrm{font_size}=12,\mathrm{color}=0,\mathrm{weight}=1.2\right);\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{while}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}-5<\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔x+\mathrm{glyphW};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dx}≔\mathrm{dx}-\mathrm{glyphW}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dymax}<\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dymax}≔\mathrm{dy}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}w-\frac{3\mathrm{glyphW}}{4}\le x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}n=\mathrm{hi}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}x≔\frac{\mathrm{glyphW}}{4};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}y≔y+25+\mathrm{dymax};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{dymax}≔0;\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}h\le y\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{then}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{break}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{if}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do};\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{img}≔\mathrm{img}\left[1..\mathrm{round}\left(y+10\right),..,..\right];\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{assign}\left(\mathrm{cat}\left('\mathrm{img_}',\mathrm{chart}\left[2\right]\right),\mathrm{img}\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 > $\mathrm{Embed}\left(\mathrm{img_jp}\right)$

 > $\mathrm{Embed}\left(\mathrm{img_sy1}\right)$

 > $\mathrm{Embed}\left(\mathrm{img_sy2}\right)$

ASCII to Cyrillic and Greek mapping.

 > $\mathrm{img}≔\mathrm{Create}\left(105,640,\mathrm{channels}=3,\mathrm{background}=\mathrm{white}\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,75,"Vostok, Pilot = \f0Vostok, Pilot",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Text}\left(\mathrm{img},10,25,"Archimedes = \f4Arximhdhw",\mathrm{position}="E",\mathrm{font}=11,\mathrm{font_size}=25,\mathrm{weight}=1.2,\mathrm{color}=0\right):$
 > $\mathrm{Embed}\left(\mathrm{img}\right)$

Compatibility

 • The ImageTools[Draw][Text] command was introduced in Maple 2018.