The truetype-clx Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The truetype-clx Reference Manual

This is the truetype-clx Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Fri Jun 26 12:31:56 2020 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

truetype-clx

clx-truetype minus the clx, just outputs 2d arrays of alpha values with metrics.

TEXT-PIXARRAY works for single character strings, outputting just the glyph with no padding.

TEXT-LINE-PIXARRAY works for text strings and adds line height padding.

Font is a string designating the path to a ttf font.

Adjust inch/pts to your needs, currently set at 72.

e.g. This is the output difference between text-line-pixarray and text-pixarray as output by the following command. (visualize:this (truetype-clx:text-line-pixarray (font-match:find-match "deja") "J" 28 144 144) :surface surface :zoom 5 :gridp t :spacing 5 :second-spacing 10 :palette (palette:create-alpha-palette 256))

https://imgur.com/a/mYPkGp4

https://imgur.com/a/NBDlaVW


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 truetype-clx

License

MIT

Description

Ripped out rendering from clx-truetype

Version

0.1

Dependencies
Source

truetype-clx.asd (file)

Component

truetype-clx.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 truetype-clx.asd

Location

truetype-clx.asd

Systems

truetype-clx (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 truetype-clx/truetype-clx.lisp

Parent

truetype-clx (system)

Location

truetype-clx.lisp

Packages

truetype-clx

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 truetype-clx

Source

truetype-clx.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: baseline-to-baseline FONT PT DPI

Returns distance between baselines of @var{font}. ascent - descent + line gap

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: font-ascent FONT PT DPI

Returns ascent of @var{font}.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: font-descent FONT PT DPI

Returns descent of @var{font}.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: font-line-gap FONT PT DPI

Returns line gap of @var{font}.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-bounding-box FONT PT-SIZE STRING DPI-X DPI-Y &key UNDERLINE OVERLINE

Returns text bounding box. Text bounding box is only for contours. Bounding box for space (#x20) is zero.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-height FONT PT STRING DPI-X DPI-Y

Returns height of text bounding box.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-line-bounding-box FONT PT-SIZE STRING DPI-X DPI-Y &key UNDERLINE OVERLINE

Returns text line bounding box. Text line bounding box is bigger than text bounding box. It’s height is ascent + descent, width is sum of advance widths minus sum of kernings.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-line-height FONT PT STRING DPI-X DPI-Y

Returns height of text line bounding box.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-line-pixarray FONT STRING PT DPI-X DPI-Y &key ANTIALIAS UNDERLINE OVERLINE STRIKETHROUGH

Render a text line of ’face’, returning a 2D (unsigned-byte 8) array suitable as an alpha mask, and dimensions. This function returns five values: alpha mask byte array, x-origin, y-origin (subtracted from position before rendering), horizontal and vertical advances.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-line-width FONT PT STRING DPI-X DPI-Y

Returns width of text line bounding box. It is sum of advance widths minus sum of kernings.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-pixarray FONT STRING PT DPI-X DPI-Y &key ANTIALIAS UNDERLINE OVERLINE STRIKETHROUGH

Render a text string of FONT, returning a 2D (unsigned-byte 8) array suitable as an alpha mask, and dimensions. This function returns five values: alpha mask byte array, x-origin, y-origin (subtracted from position before rendering), horizontal and vertical advances. Only works for single characters.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: text-width FONT PT STRING DPI-X DPI-Y

Returns width of text bounding box.

Package

truetype-clx

Source

truetype-clx.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *inch/pts*

How many pts per inch. CSS/android is 96

Package

truetype-clx

Source

truetype-clx.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: aa-bin/update-state STATE PATHS

Update state for not antialiasing renderer.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: cells-sweep STATE FUNCTION &optional FUNCTION-SPAN ANTIALIAS

Wrapper around antialising and not antialiasig renderers.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: clamp VALUE MIN MAX

Clamps the value ’value’ into the range [min,max].

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: clamp-alpha ALPHA
Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: make-state &optional ANTIALIAS

Wrapper around antialising and not antialiasing renderers.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: pt->pixels PT-SIZE DPI UNITS/EM

px = funits*coeff. Function returns coeff.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: update-state STATE PATHS &optional ANTIALIAS

Wrapper around antialising and not antialiasing renderers.

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: xmax BOUNDING-BOX

Returns right side x of @var{bounding-box}

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: xmin BOUNDING-BOX

Returns left side x of @var{bounding-box}

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: ymax BOUNDING-BOX

Returns top side y of @var{bounding-box}

Package

truetype-clx

Source

truetype-clx.lisp (file)

Function: ymin BOUNDING-BOX

Returns bottom side y of @var{bounding-box}

Package

truetype-clx

Source

truetype-clx.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, truetype-clx.asd: The truetype-clx․asd file
File, Lisp, truetype-clx/truetype-clx.lisp: The truetype-clx/truetype-clx․lisp file

L
Lisp File, truetype-clx.asd: The truetype-clx․asd file
Lisp File, truetype-clx/truetype-clx.lisp: The truetype-clx/truetype-clx․lisp file

T
truetype-clx.asd: The truetype-clx․asd file
truetype-clx/truetype-clx.lisp: The truetype-clx/truetype-clx․lisp file

Jump to:   F   L   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   B   C   F   M   P   T   U   X   Y  
Index Entry  Section

A
aa-bin/update-state: Internal functions

B
baseline-to-baseline: Exported functions

C
cells-sweep: Internal functions
clamp: Internal functions
clamp-alpha: Internal functions

F
font-ascent: Exported functions
font-descent: Exported functions
font-line-gap: Exported functions
Function, aa-bin/update-state: Internal functions
Function, baseline-to-baseline: Exported functions
Function, cells-sweep: Internal functions
Function, clamp: Internal functions
Function, clamp-alpha: Internal functions
Function, font-ascent: Exported functions
Function, font-descent: Exported functions
Function, font-line-gap: Exported functions
Function, make-state: Internal functions
Function, pt->pixels: Internal functions
Function, text-bounding-box: Exported functions
Function, text-height: Exported functions
Function, text-line-bounding-box: Exported functions
Function, text-line-height: Exported functions
Function, text-line-pixarray: Exported functions
Function, text-line-width: Exported functions
Function, text-pixarray: Exported functions
Function, text-width: Exported functions
Function, update-state: Internal functions
Function, xmax: Internal functions
Function, xmin: Internal functions
Function, ymax: Internal functions
Function, ymin: Internal functions

M
make-state: Internal functions

P
pt->pixels: Internal functions

T
text-bounding-box: Exported functions
text-height: Exported functions
text-line-bounding-box: Exported functions
text-line-height: Exported functions
text-line-pixarray: Exported functions
text-line-width: Exported functions
text-pixarray: Exported functions
text-width: Exported functions

U
update-state: Internal functions

X
xmax: Internal functions
xmin: Internal functions

Y
ymax: Internal functions
ymin: Internal functions

Jump to:   A   B   C   F   M   P   T   U   X   Y  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*inch/pts*: Internal special variables

S
Special Variable, *inch/pts*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

P
Package, truetype-clx: The truetype-clx package

S
System, truetype-clx: The truetype-clx system

T
truetype-clx: The truetype-clx system
truetype-clx: The truetype-clx package

Jump to:   P   S   T