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

Safe HaskellNone



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.



simple :: Text -> Text -> Symbol Source #

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.




  • name :: Text
  • absolute_y :: Bool

    Turn 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]
Show Symbol # 
Instance details

Defined in Ui.Symbol

data Glyph Source #




  • glyph_text :: Text

    Unicode characters that make up the glyph.

  • glyph_font :: Maybe Font
  • glyph_size :: Int

    Relative 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 :: Int

    Rotate the glyph in degrees.

Show Glyph # 
Instance details

Defined in Ui.Symbol


showsPrec :: Int -> Glyph -> ShowS #

show :: Glyph -> String #

showList :: [Glyph] -> ShowS #