The pango-markup Reference Manual

This is the pango-markup Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Feb 15 07:05:06 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 pango-markup

A small library to generate pango-style text markup.

Maintainer

Yukari Hafner <>

Author

Yukari Hafner <>

Home Page

https://Shinmera.github.io/pango-markup/

Source Control

(GIT https://github.com/Shinmera/pango-markup.git)

Bug Tracker

https://github.com/Shinmera/pango-markup/issues

License

zlib

Version

1.0.0

Dependency

documentation-utils (system).

Source

pango-markup.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 pango-markup/pango-markup.asd

Source

pango-markup.asd.

Parent Component

pango-markup (system).

ASDF Systems

pango-markup.


3.1.2 pango-markup/package.lisp

Source

pango-markup.asd.

Parent Component

pango-markup (system).

Packages

pango-markup.


3.1.3 pango-markup/pango.lisp

Dependency

package.lisp (file).

Source

pango-markup.asd.

Parent Component

pango-markup (system).

Public Interface
Internals

3.1.4 pango-markup/documentation.lisp

Dependency

pango.lisp (file).

Source

pango-markup.asd.

Parent Component

pango-markup (system).


4 Packages

Packages are listed by definition order.


4.1 pango-markup

Source

package.lisp.

Nickname

org.shirakumo.pango-markup

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: escape-char (char stream)

Escapes the given char if necessary and writes it to stream.

This makes the following substitutions:
< ::= &lt;
> ::= &gt;
& ::= &amp;
’ ::= &#39;
Any other character is written verbatim to the stream.

Package

pango-markup.

Source

pango.lisp.

Function: markup-regions (text regions)

Marks up the given text using the list of markup regions.

Each entry in the region list should be of the following form:

REGION ::= (START END . MARKUP)
START — An integer describing the index in the text at which the markup should start applying.
END — An integer describing the index up until which the markup should apply.
MARKUP — Either a list of MARKUP initargs, or a MARKUP instance.

For instance, the following invocation:

(markup-regions "1 22 333"
’((0 1 :color red)
(5 8 :font (:family "monospace"))))

Produces the following result:

<span color=’red’>1</span> 22 <span font_family=’monospace’>333</span>

Note that while it is allowed to nest markup regions, this function makes no attempt at detecting and warning about invalid region combinations such as ((1 3 ..) (2 4 ..)).

See MARKUP
See FONT

Package

pango-markup.

Source

pango.lisp.


5.1.2 Generic functions

Generic Reader: background (object)

Accesses the background colour of the markup region.

A colour can either be the name of a colour as a string, an encoded RGB integer, or a list of R, G, B, and optional A elements with each element being an integer between 0 and 255.

See MARKUP

Package

pango-markup.

Methods
Reader Method: background ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

background.

Generic Writer: (setf background) (object)
Package

pango-markup.

Methods
Writer Method: (setf background) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

background.

Generic Function: closing-tag (markup)

Returns the closing tag that ends the marked up text region.

You should be able to splice this tag after the text region you wish to mark up.

Note that the text between the opening-tag and the closing-tag should be properly entity-escaped using ESCAPE-CHAR.

See ESCAPE-CHAR
See OPENING-TAG
See MARKUP

Package

pango-markup.

Methods
Method: closing-tag (markup)
Source

pango.lisp.

Generic Reader: fallback (object)

Accesses whether fallback font glyphs should be enabled.

This defaults to true and should not need to be changed.

See MARKUP

Package

pango-markup.

Methods
Reader Method: fallback ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

fallback.

Generic Writer: (setf fallback) (object)
Package

pango-markup.

Methods
Writer Method: (setf fallback) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

fallback.

Generic Reader: family (object)

Accesses the font family name.

The font family should be a string describing the name of the family of font that should be used.

See FONT

Package

pango-markup.

Methods
Reader Method: family ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

family.

Generic Writer: (setf family) (object)
Package

pango-markup.

Methods
Writer Method: (setf family) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

family.

Generic Reader: features (object)

Accesses the font’s list of feature settings.

This should be a list of strings describing the desired OpenType features, in the same syntax as CSS uses.

See FONT

Package

pango-markup.

Methods
Reader Method: features ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

features.

Generic Writer: (setf features) (object)
Package

pango-markup.

Methods
Writer Method: (setf features) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

features.

Generic Reader: font (object)

Accesses the font properties of the markup region.

This should be set to an instance of FONT.

When supplied as an initarg, the font may also be a list of initargs to use to construct a FONT instance.

See FONT
See MARKUP

Package

pango-markup.

Methods
Reader Method: font ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

font.

Generic Writer: (setf font) (object)
Package

pango-markup.

Methods
Writer Method: (setf font) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

font.

Generic Reader: foreground (object)

Accesses the foreground text colour of the markup region.

A colour can either be the name of a colour as a string, an encoded RGB integer, or a list of R, G, B, and optional A elements with each element being an integer between 0 and 255.

See MARKUP

Package

pango-markup.

Methods
Reader Method: foreground ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

foreground.

Generic Writer: (setf foreground) (object)
Package

pango-markup.

Methods
Writer Method: (setf foreground) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

foreground.

Generic Reader: gravity (object)

Accesses the alignment gravity of the markup region.

If set should be either a gravity mode, or a list of gravity mode and gravity hint.

The gravity mode can be one of: :south :east :north :west :auto The gravity hint can be one of: :natural :strong :line

See MARKUP

Package

pango-markup.

Methods
Reader Method: gravity ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

gravity.

Generic Writer: (setf gravity) (object)
Package

pango-markup.

Methods
Writer Method: (setf gravity) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

gravity.

Generic Reader: language (object)

Accesses the language of the markup region.

The value should be a two or three letter ISO language code.

See MARKUP

Package

pango-markup.

Methods
Reader Method: language ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

language.

Generic Writer: (setf language) (object)
Package

pango-markup.

Methods
Writer Method: (setf language) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

language.

Generic Reader: letter-spacing (object)

Accesses the inter-letter spacing of the markup region.

The value should be a float describing the spacing in points.

See MARKUP

Package

pango-markup.

Methods
Reader Method: letter-spacing ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

letter-spacing.

Generic Writer: (setf letter-spacing) (object)
Package

pango-markup.

Methods
Writer Method: (setf letter-spacing) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

letter-spacing.

Generic Function: opening-tag (spec)

Returns the opening tag that describes all the markup options.

You should be able to splice this tag before the text region you wish to mark up with the given options. The end of the region to be marked should be followed by the CLOSING-TAG.

Note that the text between the opening-tag and the closing-tag should be properly entity-escaped using ESCAPE-CHAR.

See ESCAPE-CHAR
See CLOSING-TAG
See MARKUP

Package

pango-markup.

Methods
Method: opening-tag ((spec cons))
Source

pango.lisp.

Generic Reader: rise (object)

Accesses the vertical displacement of the markup region.

This displacement can be positive or negative, and must be in pango units.

See MARKUP

Package

pango-markup.

Methods
Reader Method: rise ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

rise.

Generic Writer: (setf rise) (object)
Package

pango-markup.

Methods
Writer Method: (setf rise) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

rise.

Generic Reader: size (object)

Accesses the size of the font.

The value can either be a float describing the size in points, or one of the following size units:

Absolute: :xx-small :x-small :small :medium :large :x-large :xx-large Relative: :smaller :larger

See FONT

Package

pango-markup.

Methods
Reader Method: size ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

size.

Generic Writer: (setf size) (object)
Package

pango-markup.

Methods
Writer Method: (setf size) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

size.

Generic Reader: stretch (object)

Accesses the font’s stretch factor.

Can be one of the following:

:ultra-condensed :extra-condensed :condensed :semi-condensed :normal :semi-expanded :expanded :extra-expanded :ultra-expanded

See FONT

Package

pango-markup.

Methods
Reader Method: stretch ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

stretch.

Generic Writer: (setf stretch) (object)
Package

pango-markup.

Methods
Writer Method: (setf stretch) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

stretch.

Generic Reader: strikethrough (object)

Accesses the strikethrough options of the markup region.

Can be either T or a list of T and the strikethrough colour.

A colour can either be the name of a colour as a string, an encoded RGB integer, or a list of R, G, B, and optional A elements with each element being an integer between 0 and 255.

See MARKUP

Package

pango-markup.

Methods
Reader Method: strikethrough ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

strikethrough.

Generic Writer: (setf strikethrough) (object)
Package

pango-markup.

Methods
Writer Method: (setf strikethrough) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

strikethrough.

Generic Reader: style (object)

Accesses the font’s style variant.

Can be one of the following:

:normal :oblique :italic

See FONT

Package

pango-markup.

Methods
Reader Method: style ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

style.

Generic Writer: (setf style) (object)
Package

pango-markup.

Methods
Writer Method: (setf style) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

style.

Generic Reader: underline (object)

Accesses the underline options of the markup region.

If set should be either an underline mode, or a list of underline mode and underline colour. The underline mode should be one of

:none T :single :double :low :error

Where T is synonymous with :single

The colour can either be the name of a colour as a string, an encoded RGB integer, or a list of R, G, B, and optional A elements with each element being an integer between 0 and 255.

See MARKUP

Package

pango-markup.

Methods
Reader Method: underline ((markup markup))

automatically generated reader method

Source

pango.lisp.

Target Slot

underline.

Generic Writer: (setf underline) (object)
Package

pango-markup.

Methods
Writer Method: (setf underline) ((markup markup))

automatically generated writer method

Source

pango.lisp.

Target Slot

underline.

Generic Reader: variant (object)

Accesses the font’s variant.

Can be one of the following:

:normal :small-caps

See FONT

Package

pango-markup.

Methods
Reader Method: variant ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

variant.

Generic Writer: (setf variant) (object)
Package

pango-markup.

Methods
Writer Method: (setf variant) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

variant.

Generic Reader: weight (object)

Accesses the font’s weight or boldness.

Can be either a numeric weight, or one of the following:

:ultra-light :light :normal :bold :ultra-bold :heavy

See FONT

Package

pango-markup.

Methods
Reader Method: weight ((font font))

automatically generated reader method

Source

pango.lisp.

Target Slot

weight.

Generic Writer: (setf weight) (object)
Package

pango-markup.

Methods
Writer Method: (setf weight) ((font font))

automatically generated writer method

Source

pango.lisp.

Target Slot

weight.


5.1.3 Standalone methods

Method: shared-initialize :after ((markup markup) slots &key font)
Source

pango.lisp.


5.1.4 Classes

Class: font

This class represents all possible font features that can be used within a markup block.

Any font property that is not a boolean can also be NIL, in which case
the value is not changed and instead inherited from the surrounding
context.

See FAMILY
See SIZE
See STYLE
See WEIGHT
See VARIANT
See STRETCH
See FEATURES

Package

pango-markup.

Source

pango.lisp.

Direct methods
Direct Default Initargs
InitargValue
:familynil
:sizenil
:stylenil
:weightnil
:variantnil
:stretchnil
:featuresnil
Direct slots
Slot: family
Type

(or null string)

Initargs

:family

Readers

family.

Writers

(setf family).

Slot: size
Type

(or null real (member :xx-small :x-small :small :medium :large :x-larg :xx-large :smaller :larger))

Initargs

:size

Readers

size.

Writers

(setf size).

Slot: style
Type

(or null (member :normal :oblique :italic))

Initargs

:style

Readers

style.

Writers

(setf style).

Slot: weight
Type

(or null real (member :ultra-light :light :normal :bold :ultra-bold :heavy))

Initargs

:weight

Readers

weight.

Writers

(setf weight).

Slot: variant
Type

(or null (member :normal :small-caps))

Initargs

:variant

Readers

variant.

Writers

(setf variant).

Slot: stretch
Type

(or null (member :ultra-condensed :extra-condensed :condensed :semi-condensed :normal :semi-expanded :expanded :extra-expanded :ultra-expanded))

Initargs

:stretch

Readers

stretch.

Writers

(setf stretch).

Slot: features
Initargs

:features

Readers

features.

Writers

(setf features).

Class: markup

This class represents markup information for a region of text.

Any markup property that is not a boolean can also be NIL, in which case the value is not changed and instead inherited from the surrounding context.

See FONT
See FOREGROUND
See BACKGROUND
See UNDERLINE
See RISE
See STRIKETHROUGH
See FALLBACK
See LANGUAGE
See LETTER-SPACING
See GRAVITY
See TAG
See MARKUP-REGIONS

Package

pango-markup.

Source

pango.lisp.

Direct methods
Direct Default Initargs
InitargValue
:fontnil
:foregroundnil
:backgroundnil
:underlinenil
:risenil
:strikethroughnil
:fallbackt
:languagenil
:letter-spacingnil
:gravitynil
Direct slots
Slot: font
Readers

font.

Writers

(setf font).

Slot: foreground
Initargs

:color, :foreground

Readers

foreground.

Writers

(setf foreground).

Slot: background
Initargs

:background

Readers

background.

Writers

(setf background).

Slot: underline
Initargs

:underline

Readers

underline.

Writers

(setf underline).

Slot: rise
Initargs

:rise

Readers

rise.

Writers

(setf rise).

Slot: strikethrough
Initargs

:strike, :strikethrough

Readers

strikethrough.

Writers

(setf strikethrough).

Slot: fallback
Initargs

:fallback

Readers

fallback.

Writers

(setf fallback).

Slot: language
Initargs

:lang, :language

Readers

language.

Writers

(setf language).

Slot: letter-spacing
Initargs

:spacing, :letter-spacing

Readers

letter-spacing.

Writers

(setf letter-spacing).

Slot: gravity
Initargs

:gravity

Readers

gravity.

Writers

(setf gravity).


5.2 Internals


5.2.1 Ordinary functions

Function: enlist (list &rest items)
Package

pango-markup.

Source

pango.lisp.

Function: null-if (nullable item)
Package

pango-markup.

Source

pango.lisp.


5.2.2 Generic functions

Generic Function: format-color (o color &rest args)
Package

pango-markup.

Methods
Method: format-color (o (color list) &rest args)
Source

pango.lisp.

Method: format-color (o (color integer) &rest args)
Source

pango.lisp.

Method: format-color (o color &rest args)
Source

pango.lisp.

Generic Function: format-escape (o thing &rest args)
Package

pango-markup.

Methods
Method: format-escape (o (string string) &rest args)
Source

pango.lisp.

Method: format-escape (o (symbol symbol) &rest args)
Source

pango.lisp.

Method: format-escape (o thing &rest args)
Source

pango.lisp.

Generic Function: tag (markup)
Package

pango-markup.

Methods
Method: tag ((markup markup))
Source

pango.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
B   C   E   F   G   L   M   N   O   R   S   T   U   V   W  
Index Entry  Section

(
(setf background): Public generic functions
(setf background): Public generic functions
(setf fallback): Public generic functions
(setf fallback): Public generic functions
(setf family): Public generic functions
(setf family): Public generic functions
(setf features): Public generic functions
(setf features): Public generic functions
(setf font): Public generic functions
(setf font): Public generic functions
(setf foreground): Public generic functions
(setf foreground): Public generic functions
(setf gravity): Public generic functions
(setf gravity): Public generic functions
(setf language): Public generic functions
(setf language): Public generic functions
(setf letter-spacing): Public generic functions
(setf letter-spacing): Public generic functions
(setf rise): Public generic functions
(setf rise): Public generic functions
(setf size): Public generic functions
(setf size): Public generic functions
(setf stretch): Public generic functions
(setf stretch): Public generic functions
(setf strikethrough): Public generic functions
(setf strikethrough): Public generic functions
(setf style): Public generic functions
(setf style): Public generic functions
(setf underline): Public generic functions
(setf underline): Public generic functions
(setf variant): Public generic functions
(setf variant): Public generic functions
(setf weight): Public generic functions
(setf weight): Public generic functions

B
background: Public generic functions
background: Public generic functions

C
closing-tag: Public generic functions
closing-tag: Public generic functions

E
enlist: Private ordinary functions
escape-char: Public ordinary functions

F
fallback: Public generic functions
fallback: Public generic functions
family: Public generic functions
family: Public generic functions
features: Public generic functions
features: Public generic functions
font: Public generic functions
font: Public generic functions
foreground: Public generic functions
foreground: Public generic functions
format-color: Private generic functions
format-color: Private generic functions
format-color: Private generic functions
format-color: Private generic functions
format-escape: Private generic functions
format-escape: Private generic functions
format-escape: Private generic functions
format-escape: Private generic functions
Function, enlist: Private ordinary functions
Function, escape-char: Public ordinary functions
Function, markup-regions: Public ordinary functions
Function, null-if: Private ordinary functions

G
Generic Function, (setf background): Public generic functions
Generic Function, (setf fallback): Public generic functions
Generic Function, (setf family): Public generic functions
Generic Function, (setf features): Public generic functions
Generic Function, (setf font): Public generic functions
Generic Function, (setf foreground): Public generic functions
Generic Function, (setf gravity): Public generic functions
Generic Function, (setf language): Public generic functions
Generic Function, (setf letter-spacing): Public generic functions
Generic Function, (setf rise): Public generic functions
Generic Function, (setf size): Public generic functions
Generic Function, (setf stretch): Public generic functions
Generic Function, (setf strikethrough): Public generic functions
Generic Function, (setf style): Public generic functions
Generic Function, (setf underline): Public generic functions
Generic Function, (setf variant): Public generic functions
Generic Function, (setf weight): Public generic functions
Generic Function, background: Public generic functions
Generic Function, closing-tag: Public generic functions
Generic Function, fallback: Public generic functions
Generic Function, family: Public generic functions
Generic Function, features: Public generic functions
Generic Function, font: Public generic functions
Generic Function, foreground: Public generic functions
Generic Function, format-color: Private generic functions
Generic Function, format-escape: Private generic functions
Generic Function, gravity: Public generic functions
Generic Function, language: Public generic functions
Generic Function, letter-spacing: Public generic functions
Generic Function, opening-tag: Public generic functions
Generic Function, rise: Public generic functions
Generic Function, size: Public generic functions
Generic Function, stretch: Public generic functions
Generic Function, strikethrough: Public generic functions
Generic Function, style: Public generic functions
Generic Function, tag: Private generic functions
Generic Function, underline: Public generic functions
Generic Function, variant: Public generic functions
Generic Function, weight: Public generic functions
gravity: Public generic functions
gravity: Public generic functions

L
language: Public generic functions
language: Public generic functions
letter-spacing: Public generic functions
letter-spacing: Public generic functions

M
markup-regions: Public ordinary functions
Method, (setf background): Public generic functions
Method, (setf fallback): Public generic functions
Method, (setf family): Public generic functions
Method, (setf features): Public generic functions
Method, (setf font): Public generic functions
Method, (setf foreground): Public generic functions
Method, (setf gravity): Public generic functions
Method, (setf language): Public generic functions
Method, (setf letter-spacing): Public generic functions
Method, (setf rise): Public generic functions
Method, (setf size): Public generic functions
Method, (setf stretch): Public generic functions
Method, (setf strikethrough): Public generic functions
Method, (setf style): Public generic functions
Method, (setf underline): Public generic functions
Method, (setf variant): Public generic functions
Method, (setf weight): Public generic functions
Method, background: Public generic functions
Method, closing-tag: Public generic functions
Method, fallback: Public generic functions
Method, family: Public generic functions
Method, features: Public generic functions
Method, font: Public generic functions
Method, foreground: Public generic functions
Method, format-color: Private generic functions
Method, format-color: Private generic functions
Method, format-color: Private generic functions
Method, format-escape: Private generic functions
Method, format-escape: Private generic functions
Method, format-escape: Private generic functions
Method, gravity: Public generic functions
Method, language: Public generic functions
Method, letter-spacing: Public generic functions
Method, opening-tag: Public generic functions
Method, rise: Public generic functions
Method, shared-initialize: Public standalone methods
Method, size: Public generic functions
Method, stretch: Public generic functions
Method, strikethrough: Public generic functions
Method, style: Public generic functions
Method, tag: Private generic functions
Method, underline: Public generic functions
Method, variant: Public generic functions
Method, weight: Public generic functions

N
null-if: Private ordinary functions

O
opening-tag: Public generic functions
opening-tag: Public generic functions

R
rise: Public generic functions
rise: Public generic functions

S
shared-initialize: Public standalone methods
size: Public generic functions
size: Public generic functions
stretch: Public generic functions
stretch: Public generic functions
strikethrough: Public generic functions
strikethrough: Public generic functions
style: Public generic functions
style: Public generic functions

T
tag: Private generic functions
tag: Private generic functions

U
underline: Public generic functions
underline: Public generic functions

V
variant: Public generic functions
variant: Public generic functions

W
weight: Public generic functions
weight: Public generic functions