bitmapfont

package module
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 11

README

bitmapfont (v3)

PkgGoDev

Package bitmapfont provides font.Face values of 12px bitmap glyphs.

API

var Face font.Face
var FaceEA font.Face
var FaceSC font.Face
var FaceSCEA font.Face
var FaceTC font.Face
var FaceTCEA font.Face

Example

The EA version includes wide glyphs for the characters that have East Asian ambiguous widths (e.g., , , α).

The SC version prefers simplified Chinese characters.

The TC version prefers traditional Chinese characters.

Sources

There is one font face with glyph size 6x13 for halfwidth, and 12x13 for fullwidth so far.

Baekmuk License

Copyright (c) 1986-2002 Kim Jeong-Hwan
All rights reserved.

Permission to use, copy, modify and distribute this font is
hereby granted, provided that both the copyright notice and
this permission notice appear in all copies of the font,
derivative works or modified versions, and that the following
acknowledgement appear in supporting documentation:
    Baekmuk Batang, Baekmuk Dotum, Baekmuk Gulim, and
    Baekmuk Headline are registered trademarks owned by
    Kim Jeong-Hwan.

M+ Bitmap Font License

-
M+ BITMAP FONTS            Copyright 2002-2005  COZ <coz@users.sourceforge.jp>
-

LICENSE




These fonts are free softwares.
Unlimited permission is granted to use, copy, and distribute it, with
or without modification, either commercially and noncommercially.
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.

Documentation

Overview

Package bitmapfont offers a font.Face value of some bitmap fonts.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Face is a font.Face of the bitmap font (12px regular).
	Face font.Face

	// FaceEA is a font.Face of the bitmap font (12px regular, prefer East Asian wide characters).
	FaceEA font.Face
)
View Source
var (
	// FaceSC is a font.Face of the bitmap font (12px regular, prefer simplified Chinese characters).
	FaceSC font.Face

	// FaceSCEA is a font.Face of the bitmap font (12px regular, prefer simplified Chinese characters and East Asia wide characters).
	FaceSCEA font.Face
)
View Source
var (
	// FaceTC is a font.Face of the bitmap font (12px regular, prefer traditional Chinese characters).
	FaceTC font.Face

	// FaceTCEA is a font.Face of the bitmap font (12px regular, prefer traditional Chinese characters and East Asia wide characters).
	FaceTCEA font.Face
)

Functions

func PresentationForms

func PresentationForms(input string, defaultDirection Direction, lang language.Tag) string

PresentationForms returns runes as presentation forms in order to render it easily.

PresentationForms mainly converts RTL texts into LTR glyphs for presentation. The result can be passed to e.g., golang.org/x/image.Drawer's DrawString. PresentationForms should work with texts whose directions are mixed with Unicode Bidi algorithm [1].

lang represents a language that is a hint to compose the representation forms. lang is not used in the implementation yet, but might be used in the future.

[1] https://unicode.org/reports/tr9/

Types

type Direction

type Direction int
const (
	DirectionLeftToRight Direction = iota
	DirectionRightToLeft
)

Directories

Path Synopsis
internal
ark
bdf
wqi

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL