// SPDX-License-Identifier: Unlicense OR BSD-3-Clause

package tables

import 

//go:generate ../../../../typesetting-utils/generators/binarygen/cmd/generator . _src.go

type GlyphID = uint16

// NameID is the ID for entries in the font table.
type NameID uint16

type Tag = opentype.Tag

// Float1616 is a float32, represented in
// fixed 16.16 format in font files.
type Float1616 = float32

func ( uint32) Float1616 {
	// value are actually signed integers
	return Float1616(int32()) / (1 << 16)
}

func ( Float1616) uint32 {
	return uint32(int32( * (1 << 16)))
}

// Fixed214 is a number stored as a fixed 2.14 integer
type Fixed214 = Coord

func ( uint16) float32 {
	// value are actually signed integers
	return float32(int16()) / (1 << 14)
}

// Coord is a real number in [-1;1], stored as a fixed 2.14 integer
type Coord int16

func ( float64) Coord {
	return Coord( * (1 << 14))
}

func abs( Coord) Coord {
	if  < 0 {
		return -
	}
	return 
}

func readUint24( []byte) uint32 {
	_ = [2] // bounds check hint to compiler; see golang.org/issue/14808
	return uint32([2]) | uint32([1])<<8 | uint32([0])<<16
}

// Number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone.
type longdatetime = uint64

// PlatformID represents the platform id for entries in the name table.
type PlatformID uint16

// EncodingID represents the platform specific id for entries in the name table.
// The most common values are provided as constants.
type EncodingID uint16

// LanguageID represents the language used by an entry in the name table
type LanguageID uint16

// Offset16 is an offset into the input byte slice
type Offset16 uint16

// Offset32 is an offset into the input byte slice
type Offset32 uint32