This is the cl-fond Reference Manual, version 1.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:57:59 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-fond
Bindings to libfond, a simple text rendering engine for OpenGL
Nicolas Hafner <shinmera@tymoon.eu>
Nicolas Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shirakumo/cl-fond.git)
zlib
1.1.0
alexandria
(system).
cffi
(system).
trivial-features
(system).
trivial-garbage
(system).
documentation-utils
(system).
cl-opengl
(system).
package.lisp
(file).
low-level.lisp
(file).
wrapper.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-fond/cl-fond.asd
cl-fond/package.lisp
cl-fond/low-level.lisp
cl-fond/wrapper.lisp
cl-fond/documentation.lisp
cl-fond/low-level.lisp
package.lisp
(file).
cl-fond
(system).
*static*
(special variable).
buffer
(class).
buffer-font
(function).
(setf buffer-font)
(function).
buffer-framebuffer
(function).
(setf buffer-framebuffer)
(function).
buffer-height
(function).
(setf buffer-height)
(function).
buffer-program
(function).
(setf buffer-program)
(function).
buffer-texture
(function).
(setf buffer-texture)
(function).
buffer-width
(function).
(setf buffer-width)
(function).
compute-extent
(function).
compute-extent-u
(function).
compute-text
(function).
compute-text-u
(function).
decode-utf8
(function).
extent
(class).
extent-b
(function).
(setf extent-b)
(function).
extent-gap
(function).
(setf extent-gap)
(function).
extent-l
(function).
(setf extent-l)
(function).
extent-r
(function).
(setf extent-r)
(function).
extent-t
(function).
(setf extent-t)
(function).
fond-error
(function).
fond-error-string
(function).
font
(class).
font-atlas
(function).
(setf font-atlas)
(function).
font-characters
(function).
(setf font-characters)
(function).
font-chardata
(function).
(setf font-chardata)
(function).
font-codepoints
(function).
(setf font-codepoints)
(function).
font-converted-codepoints
(function).
(setf font-converted-codepoints)
(function).
font-file
(function).
(setf font-file)
(function).
font-fontdata
(function).
(setf font-fontdata)
(function).
font-fontinfo
(function).
(setf font-fontinfo)
(function).
font-height
(function).
(setf font-height)
(function).
font-index
(function).
(setf font-index)
(function).
font-oversample
(function).
(setf font-oversample)
(function).
font-size
(function).
(setf font-size)
(function).
font-width
(function).
(setf font-width)
(function).
free-buffer
(function).
free-font
(function).
load-buffer
(function).
load-font
(function).
load-font-fit
(function).
render-buffer
(function).
render-buffer-u
(function).
update-text
(function).
update-text-u
(function).
*here*
(special variable).
cl-fond/wrapper.lisp
low-level.lisp
(file).
cl-fond
(system).
buffer
(class).
c-object
(class).
charset
(function).
compute-extent
(function).
compute-text
(function).
error-code
(reader method).
(setf error-code)
(writer method).
file
(function).
fond-error
(condition).
font
(reader method).
(setf font)
(writer method).
(setf font)
(method).
font
(class).
free
(method).
handle
(reader method).
(setf handle)
(writer method).
height
(method).
height
(method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
make-buffer
(function).
make-font
(function).
render
(method).
size
(function).
text-height
(function).
texture
(method).
texture
(method).
update-text
(function).
width
(method).
width
(method).
allocate-handle
(generic function).
calloc
(function).
free-handle
(generic function).
show-error
(function).
string->char*
(function).
cl-fond/documentation.lisp
wrapper.lisp
(file).
cl-fond
(system).
Packages are listed by definition order.
cl-fond-cffi
org.shirakumo.fraf.fond.cffi
cffi
.
common-lisp
.
*static*
(special variable).
buffer
(class).
buffer-font
(function).
(setf buffer-font)
(function).
buffer-framebuffer
(function).
(setf buffer-framebuffer)
(function).
buffer-height
(function).
(setf buffer-height)
(function).
buffer-program
(function).
(setf buffer-program)
(function).
buffer-texture
(function).
(setf buffer-texture)
(function).
buffer-width
(function).
(setf buffer-width)
(function).
compute-extent
(function).
compute-extent-u
(function).
compute-text
(function).
compute-text-u
(function).
decode-utf8
(function).
extent
(class).
extent-b
(function).
(setf extent-b)
(function).
extent-gap
(function).
(setf extent-gap)
(function).
extent-l
(function).
(setf extent-l)
(function).
extent-r
(function).
(setf extent-r)
(function).
extent-t
(function).
(setf extent-t)
(function).
fond-error
(function).
fond-error-string
(function).
font
(class).
font-atlas
(function).
(setf font-atlas)
(function).
font-characters
(function).
(setf font-characters)
(function).
font-chardata
(function).
(setf font-chardata)
(function).
font-codepoints
(function).
(setf font-codepoints)
(function).
font-converted-codepoints
(function).
(setf font-converted-codepoints)
(function).
font-file
(function).
(setf font-file)
(function).
font-fontdata
(function).
(setf font-fontdata)
(function).
font-fontinfo
(function).
(setf font-fontinfo)
(function).
font-height
(function).
(setf font-height)
(function).
font-index
(function).
(setf font-index)
(function).
font-oversample
(function).
(setf font-oversample)
(function).
font-size
(function).
(setf font-size)
(function).
font-width
(function).
(setf font-width)
(function).
free-buffer
(function).
free-font
(function).
load-buffer
(function).
load-font
(function).
load-font-fit
(function).
render-buffer
(function).
render-buffer-u
(function).
update-text
(function).
update-text-u
(function).
*here*
(special variable).
cl-fond
org.shirakumo.fraf.fond
cffi
.
common-lisp
.
buffer
(class).
c-object
(class).
charset
(function).
compute-extent
(function).
compute-text
(function).
error-code
(generic reader).
(setf error-code)
(generic writer).
file
(function).
fond-error
(condition).
font
(generic reader).
(setf font)
(generic function).
font
(class).
free
(generic function).
handle
(generic reader).
(setf handle)
(generic writer).
height
(generic function).
make-buffer
(function).
make-font
(function).
render
(generic function).
size
(function).
text-height
(function).
texture
(generic function).
update-text
(function).
width
(generic function).
allocate-handle
(generic function).
calloc
(function).
free-handle
(generic function).
show-error
(function).
string->char*
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Variable containing the path to the static directory. That directory contains the precompiled library binaries.
Pointer to the font that it renders.
This can be exchanged for another font, if you should
decide to want to render with a different font.
See BUFFER
This is an internal field.
See BUFFER
The height of the texture.
See BUFFER
This is an internal field.
See BUFFER
The OpenGL texture ID to which this buffer renders to.
See BUFFER
The width of the texture.
See BUFFER
Returns a string containing all the characters this font instance is capable of drawing.
See FONT
Compute the extent of the given text.
You must allocate the extent struct yourself and make
sure it is zeroed out.
See FONT
See EXTENT
Compute the extent of the given text in pixels.
Returns a property list with the following entries:
:L — The extent to the left from zero.
:R — The extent to the right from zero.
:T — The extent up from the baseline.
:B — The extent down from the baseline.
:GAP — The gap between two lines of text.
See FONT
Same as COMPUTE-EXTENT but taking an UTF32 encoded string and its size.
See COMPUTE-EXTENT
See FONT
See EXTENT
Compute the Vertex Array Object to render the given text.
Here, n and vao are output arguments, containing the
number of elements and the OpenGL VAO ID respectively.
The text must be UTF8 encoded and null-terminated. The
returned VAO contains two arrays, at location 0 and 1,
with both being vec2s. The first being the vertex
coordinates and the second being the texture
coordinates. The vertex coordinates start at 0 and
increase in x and y as per the font’s size. You are
responsible for scaling it as appropriate for your
display. The texture coordinates are for the font’s
atlas texture. If the text contains a Linefeed
character (U+000A) a new line is started automatically
by resetting X to 0 and decreasing Y by the necessary
height for a new line.
See FONT
Compute the vertex array object to draw the given text.
Returns two values: the OpenGL VAO ID, and the number of
elements stored in the VAO.
In order to actually use this, you will need to bind the
font’s texture and use a vertex and fragment shader that
draw the VAO as appropriate. The VAO contains two arrays
of vec2s for this purpose: the first being the vertex
coordinates, and the second being the texture coordinates.
The texture only contains a red component, with the other
components being set to zero.
See FONT
Same as COMPUTE-EXTENT but taking an UTF32 encoded string and its size.
See COMPUTE-TEXT
See FONT
Decode the given UTF8 string into an UTF32 string.
The resulting string is put into decoded, and its size is put into size. This is used by the non _u functions to decode the string. You may want to use this internally, if you need to re-use the same string often and don’t wnat to pay the conversion cost.
How far down the text extends from its baseline.
See EXTENT
The gap between lines of the text.
See EXTENT
How far to the left the text extends from zero.
See EXTENT
How far to the right the text extends from zero.
See EXTENT
How far up the text extends from its baseline.
See EXTENT
Returns the pathname for the TTF file this font contains.
See FONT
Return the current error code.
Return a string for a human-readable error message of the given error code.
The OpenGL texture ID for the atlas.
See FONT
A UTF8 encoded string of characters that this font instance will be able to render.
Must be null-terminated.
See FONT
This is an internal field.
See FONT
An array of Unicode codepoints that this font instance will be able to render.
Must be null-terminated. This is automatically filled in for
you if it is NULL and the characters field is provided instead.
See FONT
This is an internal field.
See FONT
Accessor for the path to the TTF file.
See FONT
This is an internal field.
See FONT
This is an internal field.
See FONT
The height of the glyph texture atlas.
See FONT
Accessor for the index of the font within the TTF file.
You probably don’t need to set this.
See FONT
How much oversampling should be done.
Higher oversampling might improve the quality of the rendering,
but will need a much bigger atlas size:
width*oversampling,height*oversampling
See FONT
The vertical font size in pixels.
If you render it above this resolution, you’ll get blurring.
See FONT
The width of the glyph texture atlas.
See FONT
Free all the data that was allocated into the struct by fond_load_buffer.
This will /not/ free the font struct.
See BUFFER
Free all the data that was allocated into the struct by LOAD-FONT*
This will /not/ free the characters array, the file
array, or the codepoints array if the codepoints
array was not computed by LOAD-FONT*
See FONT
Load the buffer struct and allocate the necessary OpenGL data.
The following fields must be set in the struct:
font
width
height
See BUFFER
Load the font struct and allocate the necessary OpenGL data.
The following fields must be set in the struct:
file
size
width
height
characters or codepoints
See FONT
Load the font struct, attempting to fit an atlas automatically.
This may not result in the most compact atlas possible.
max_size is the maximum size of the width or height
that can be reached before it gives up.
The following fields must be set in the struct:
file
size
characters or codepoints
See FONT
Create a new buffer instance.
The font is the font instance to render with, and the width
and height specify the dimensions of the texture that this
buffer renders to.
See BUFFER
See FONT
Create a new font instance for the given TTF file and character set.
The charset should be a string containing all characters that
the font should be able to draw. The index is the index of the
font within the file. Some TTF files can contain multiple fonts
in one. Usually, you won’t need to set this parameter. Oversample
is the oversampling factor that should be used. Using
oversampling might result in better quality rendering, at the
cost of massively increasing the necessary size of the atlas.
The necessary size is multiplied by the oversampling factor in
both dimensions. The width and height are optional factors that
when given specify the starting texture atlas size to use to
attempt to fit the glyphs. If this size is too small, an error
is signalled.
See FONT
Render the given text to the buffer’s texture.
The text will be rendered at the given offset, with x
and y being in pixels. color can be either 0 for white
text, or an array of four floats, representing RGBA
of the text’s colour in that order.
See BUFFER
Same as RENDER-BUFFER but taking an UTF32 encoded string and its size.
See RENDER-BUFFER
See BUFFER
Returns the font’s size in pixels.
See FONT
Returns the height of a text line from its baseline.
See FONT
The error code that the condition carries.
See FOND-ERROR
See CL-FOND-CFFI:FOND-ERROR-STRING
fond-error
)) ¶fond-error
)) ¶Accessor to the font that this buffer uses to render with.
You can change this at any time to switch what to render with.
Immediately frees the foreign object associated with the instance.
Accessor to the pointer to the foreign object.
See C-OBJECT
Returns the height of the object’s texture.
See TEXTURE
See FONT
See BUFFER
Render the given text to the buffer.
The X and Y coordinates are offsets inside the texture,
counting from the top left, as is usual for graphical
applications. Thus Y grows downwards, rather than upwards
like in OpenGL. The color should be a list of floats in
the range of [0,1] representing RGBA in that order,
defaulting to 1 for each component.
Returns the OpenGL texture ID that we rendered to.
Returns the OpenGL texture ID for the texture contained in the object.
See WIDTH
See HEIGHT
See FONT
See BUFFER
Returns the width of the object’s texture.
See TEXTURE
See FONT
See BUFFER
font
) &key file index size oversample charset width height) ¶Condition signalled when an error occurs in the underlying libfond.
See ERROR-CODE
error
.
(quote :unknown)
:error-code
This struct allows for convenience in rendering, as it will render text for you into a texture.
You must allocate this struct yourself and make sure that
it is zeroed out before you do anything with it. Not
zeroing out will land you in a world of pain.
See BUFFER-FONT
See BUFFER-TEXTURE
See BUFFER-WIDTH
See BUFFER-HEIGHT
See BUFFER-PROGRAM
See BUFFER-FRAMEBUFFER
See FREE-BUFFER
See LOAD-BUFFER
See RENDER-BUFFER
See RENDER-BUFFER-U
foreign-struct-type
.
translatable-foreign-type
.
This is a representation of a text buffer.
The buffer allows you to conveniently draw text to a texture.
You will then merely need to draw the texture to the screen,
rather than needing to manually create a shader and handle the
drawing yourself.
See C-OBJECT
See FONT
See MAKE-BUFFER
See RENDER
See WIDTH
See HEIGHT
See TEXTURE
Base class for all objects that are tied to a foreign object somehow.
See HANDLE
See ALLOCATE-HANDLE
See FREE-HANDLE
See FREE
:handle
This struct contains information about the extents of a text.
You must allocate this struct yourself and make sure that
it is zeroed out before you do anything with it. Not
zeroing out will land you in a world of pain.
See EXTENT-L
See EXTENT-R
See EXTENT-T
See EXTENT-B
See EXTENT-GAP
See COMPUTE-EXTENT
See COMPUTE-EXTENT-U
foreign-struct-type
.
translatable-foreign-type
.
This is the primary struct that contains all relevant information about a font.
You must allocate this struct yourself and make sure that
it is zeroed out before you do anything with it. Not
zeroing out will land you in a world of pain.
See FONT-FILE
See FONT-INDEX
See FONT-SIZE
See FONT-CHARACTERS
See FONT-CODEPOINTS
See FONT-WIDTH
See FONT-HEIGHT
See FONT-OVERSAMPLE
See FONT-ATLAS
See FONT-FONTDATA
See FONT-CHARDATA
See FONT-FONTINFO
See FONT-CONVERTED-CODEPOINTS
See LOAD-FONT
See LOAD-FONT-FIT
See FREE-FONT
See COMPUTE-TEXT
See COMPUTE-TEXT-U
See COMPUTE-EXTENT
See COMPUTE-EXTENT-U
foreign-struct-type
.
translatable-foreign-type
.
This is a representation of a font file.
Using this class you can draw and compute text for a specific font at a specific size. The library will take care of rendering the font glyphs to an atlas to allow fast rendering of text.
See C-OBJECT
See MAKE-FONT
See COMPUTE-TEXT
See COMPUTE-EXTENT
See FILE
See SIZE
See TEXT-HEIGHT
See WIDTH
See HEIGHT
See TEXTURE
See CHARSET
Variable containing the path to the low-level.lisp file.
Allocate memory for the given foreign type and zero it out.
Check whether any errors occurred in the underlying library and signal an error if necessary.
See FOND-ERROR
See CL-FOND-CFFI:FOND-ERROR
Convert the given string to an UTF8 encoded C-string.
Returns a pointer to the allocated data. You are responsible for freeing it when appropriate.
Jump to: | (
A B C D E F G H I L M R S T U W |
---|
Jump to: | (
A B C D E F G H I L M R S T U W |
---|
Jump to: | *
E F H S |
---|
Jump to: | *
E F H S |
---|
Jump to: | B C D E F L P S W |
---|
Jump to: | B C D E F L P S W |
---|