designationWidthfunction
The width a star's catalogue letter (α Ori) takes in pixels in the look's small monospace, 0.6 of its size a letter; 0 where it is not drawn.
Import it
import { designationWidth } from "@johnmorrisdotca/hoshi-stars/sky-labels";
Definition
function designationWidth(designation: string, style: LabelStyle): number
Parameters
| Name | Type | Description |
|---|---|---|
designation | string | The text, or an empty text for a star with none. |
style | LabelStyle | A complete look. |
Returns
number
The width in pixels.
Examples
import { designationWidth, labelStyle } from "@johnmorrisdotca/hoshi-stars/sky-labels";
console.log(designationWidth("α Ori", labelStyle()), designationWidth("α Ori", labelStyle({ designation: "none" })));27 0What it prints (run when this page was built)