Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · Medieval banners

medievalFlagfunction

A medieval banner as an SVG string: it has a viewBox and no width or height. frame() and toDataUri() from the main entry take it like any other.

Import it

import { medievalFlag } from "@johnmorrisdotca/hata/medieval";

Definition

function medievalFlag(id: string): Promise<string | null>

Parameters

NameTypeDescription
idstring

A banner's id, in any case, with or without med:.

Returns

Promise<string | null>

The SVG string, loaded when it is asked for (the drawing is a module of its own, so a page carries only the drawings it asks for), or null when the set has no such banner.

Examples

import { toDataUri } from "@johnmorrisdotca/hata";
import { medievalFlag } from "@johnmorrisdotca/hata/medieval";

const banner = await medievalFlag("med:red-cross"); // "<svg …>"
console.log(banner === null ? null : toDataUri(banner)?.startsWith("data:image/svg+xml,"));
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.