Reference · SVG faces and looks
tileFaceSvgfunction
One face's drawing, in the tile's own 30 by 40, with no tile under it: the
inside of a <symbol> or a <g>, for a board that draws its own tiles.
Null for a letter that is no face. With a design, that design's drawing of
the face (fitted to the 30 by 40), or Jarajara's own where it has none.
Import it
import { tileFaceSvg } from "@johnmorrisdotca/jarajara/faces";
Definition
function tileFaceSvg(code: string, design?: TileDesign, red?: boolean): string | null
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The one-character face code or tile identifier. |
design (optional) | TileDesign | undefined | The optional tile artwork design. |
red (optional) | boolean | Whether a supported five uses its red face drawing. |
Returns
string | null
One face's drawing, in the tile's own 30 by 40, with no tile under it: the inside of a <symbol> or a <g>, for a board that draws its own tiles. null for a letter that is no face. With a design, that design's drawing of the face (fitted to the 30 by 40), or Jarajara's own where it has none.
Examples
import { tileFaceSvg } from "@johnmorrisdotca/jarajara/faces";
console.log(tileFaceSvg("a")?.length);628What it prints (run when this page was built)