Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Ui.Symbol

Description

A Symbol is a bit of text enclosed in s, such as sharp. When rendered, it's turned into a special graphic that may be made up of multiple glyphs from different fonts. The intent is to be able to write symbols in plain ascii but have them rendered in an attractive way on the score.

Symbols are rendered at the UI level and are generally static, so instead of sending the symbol data over every time I want to draw one, the UI level maintains a mapping between symbol names and data on how to render them.

This module is split from Ui.SymbolC so importers can avoid a C dependency.

Synopsis

# Documentation

Make a simple symbol with only text.

data Symbol Source #

A Symbol has a name and a list of the Glyphs that make it up.

If the bounding box is not given, it will be inferred from the first glyph. The bounding box will be scaled by the eventual font size. Don't pass an empty glyphs list.

Constructors

 Symbol Fieldsname :: Text absolute_y :: BoolTurn on absolute y placement, disabling automatic y placement. If the glyphs have descenders and you want them to actually descend, turn this on.glyphs :: [Glyph]
Instances
 # Instance detailsDefined in Ui.Symbol MethodsshowsPrec :: Int -> Symbol -> ShowS #showList :: [Symbol] -> ShowS #

data Glyph Source #

Constructors

 Glyph Fieldsglyph_text :: TextUnicode characters that make up the glyph.glyph_font :: Maybe Font glyph_size :: IntRelative size. This is added to the font size when the glyph is drawn.glyph_align :: (Double, Double)This is scaled by the font size and added to the position of the glyph. In a symbol with only one glyph, automatic y placement will defeat a y value here unless you set sym_absolute_y.glyph_rotate :: IntRotate the glyph in degrees.
Instances
 # Instance detailsDefined in Ui.Symbol MethodsshowsPrec :: Int -> Glyph -> ShowS #show :: Glyph -> String #showList :: [Glyph] -> ShowS #