Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

Reference · Names on the brightest stars and the constellation figures as faint lines, for a sky you draw yourself: a count or a magnitude, the figure under the pointer at full strength, a body that covers part of the sky, and a look set by settings alone

labelWidthfunction

The width a name takes in pixels, from its length and the look: a Latin letter is about 0.6 of the size wide (0.75 in small capitals, which are wide in Michroma), a Japanese letter the whole size, and the letter spacing is added after each letter. It allocates nothing.

Import it

import { labelWidth } from "@johnmorrisdotca/hoshi-stars/sky-labels";

Definition

function labelWidth(name: string, style: LabelStyle): number

Parameters

NameTypeDescription
namestring

The text to draw.

styleLabelStyle

A complete look.

Returns

number

The width in pixels.

Examples

import { labelStyle, labelWidth } from "@johnmorrisdotca/hoshi-stars/sky-labels";

console.log(labelWidth("Sirius", labelStyle()), labelWidth("シリウス", labelStyle()));
59 51

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.47.0.