TextWidth

org.appliedtopology.tda4j.plot.TextWidth
object TextWidth

How wide a text is, estimated. The renderer writes SVG for whatever font the reader's browser or tool picks and has no font metrics, so a width is the advance widths of the stock face of a generic family: Helvetica (the faces sans-serif, system-ui, Arial and Liberation Sans stand for), Times (serif) or a fixed width (monospace), letter by letter, so that a row of Ws is wider than a row of is. Exact for those faces and the faces with their metrics (Arial, Liberation Sans, Liberation Serif); a font with other proportions is further off (Inter, which system-ui is on some systems, is about 6% wider).

Used to cut a long text at a limit (TextFace) and to size a legend.

Attributes

Experimental
true
Source
TextWidth.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
TextWidth.type

Members list

Type members

Classlikes

enum Family

The generic family a width is taken from.

The generic family a width is taken from.

Attributes

Companion
object
Source
TextWidth.scala
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Family

Attributes

Companion
enum
Source
TextWidth.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Family.type

Value members

Concrete methods

def of(text: String, size: Double, family: Family = ..., bold: Boolean = ...): Double

The width in pixels of text set at size pixels: a letter takes its width in the regular or the bold face of Helvetica (Sans) or Times (Serif), or 0.6 em in a monospace face, bold or not.

The width in pixels of text set at size pixels: a letter takes its width in the regular or the bold face of Helvetica (Sans) or Times (Serif), or 0.6 em in a monospace face, bold or not.

Attributes

Source
TextWidth.scala