Giggly.Label.Layout (giggly v0.2.0)

Copy Markdown View Source

A label's layout (Giggly.Label): its box, in points, and its drawing.

  • width — how wide the box is.
  • ascent — how far the box reaches above the label's baseline.
  • descent — how far it reaches below.
  • svg — the drawing, SVG markup whose root <svg> carries a viewBox and no width or height, so it is scaled to fill the box, width by ascent + descent points, its top left at the box's. Giggly writes it into the document as it is, never reading or checking it, so a broken fragment breaks the document and its own <style> or ids reach the whole drawing; it may draw past the box's edges.

Giggly justifies the box by its width along the baseline and by its whole height, ascent + descent, up from its bottom, and turns it about its place, as it does a string's.

Summary

Types

t()

@type t() :: %Giggly.Label.Layout{
  ascent: float(),
  descent: float(),
  svg: iodata(),
  width: float()
}