# Simple Lettering

``````<simple_lettering
text="Lettering 1" 		// the text
alphabet_name="London" 	        // the alphabet name
height="20.0" 			// height in mm, min 5.0, max 50.0
bold="false" 			// bold or not
italic="false" 			// italic or not
word_spacing="0.6"		        // word spacing as ratio of height
justification="centre"		//multi-line text justification
baseline="horizontal" 		// horizontal, circle_cw,
// circle_ccw, vertical
// horizontal_fixed, vertical_fixed
baseline_radius="50.0" 		// in mm, for circle baselines
baseline_length="100.0"		// in mm, for fixed baselines
auto_fit_mode="spacing"	        // spacing, letter, letter_prop,
// whole, whole_prop
/>
``````

The simple_lettering component describes the lettering parameters, such as font face, font size, bold, italic, and the baseline.

The alphabet_name parameter specifies the embroidery font face, known as the alphabet. It can only be one of the supported embroidery alphabets installed with the API.

The text parameter specifies the text of the lettering. It can contain multiple lines.

The height parameter is specified in mm. Valid range is from 5.0 to 50.0 mm.

The bold parameter is a Boolean that specifies whether the font should be bold or not. Its value can be either “true” or “false”

The italic parameter is a Boolean that specifies whether the font should be italic or not. Its value can be either “true” or “false”.

The word_spacing parameter specifies the space between words in the supplied text, ie distance occupied by the “space” character. The value is specified as a proportion of the lettering height, eg 0.6 specifying 60%.

The justification parameter string specifies the alignment of text. This is used only when the text contains multiple lines. The allowed values are “left” (left-aligned text), “right” (right-aligned text), “centre” (centred text) and “fit” (fully justified text).

The baseline parameter string specifies the baseline for the lettering object. It can be one of “horizontal”, “vertical”, “circle_cw” (circle clockwise), “circle_ccw” (circle counter-clockwise), “horizontal_fixed” or “vertical_fixed”.

For non-fixed baselines, the size of the resulting lettering cannot be specified upfront, and the text takes up whatever size is necessary for the individual letter sizes and spacings. However, the fixed baselines allow specifying the baseline_length, which in turns constrains the resulting lettering within that size. This guarantees that the lettering will not exceed the size supplied, irrespective of how many letters are in the text parameter, at the expense of possibly reducing the individual letter sizes and / or spacing.

The baseline_radius parameter specifies the radius of the circular baselines. It is ignored for other baselines. The value is in mm and the valid values are 20-1000mm.

The baseline_length parameter specifies the length of the fixed baselines. It specifies the width of the “horizontal_fixed” baseline, or the height of the “vertical_fixed” baseline. The parameter is ignored for non-fixed baselines. The value is in mm and the valid values are 20-1000mm.

The auto_fit_mode parameter specifies the constraining mode for the fixed baselines. It can be one of the following 5 values:

• “spacing” – Letter Spacing is adjusted, but the letters do not change size.
• “letter” – Letter Width (for “horizontal_fixed” baseline) or Letter Height (for “vertical_fixed” baseline) is reduced, but Spacing is unchanged.
• “letter_prop” – Letter Width and Height are reduced proportionally, but Spacing is unchanged.
• “whole” – Spacing and Letter Width (for “horizontal_fixed” baseline) or Letter Height (for “vertical_fixed” baseline) are reduced.
• “whole_prop” – Spacing and Letter Width and Height are reduced proportionally.