pangocairo

MoonBit bindings for rendering Pango layouts with Cairo

pango
cairo
ffi
native
text
rendering
moon add tonyfettes/pangocairo@0.2.0
Download zip
Version
0.2.0
License
Apache-2.0
Last updated
23 days ago
Downloads
9
README

#PangoCairo bindings for MoonBit

Native MoonBit bindings for the core PangoCairo layout and rendering functions. The package composes the existing tonyfettes/pango and tonyfettes/cairo bindings without exposing either package's C wrapper layout.

The bindings cover context resolution, context/layout creation and updates, layout and glyph rendering, path construction, error underlines, and the Cairo font-map interface. Font options, scaled fonts, the Cairo-font interface, and shape-renderer callbacks are intentionally deferred.

#
IFontMap

pub(open) trait IFontMap {
fn as_font_map(Self) -> FontMap
fn get_font_type(Self) ->
FontType
= _
fn get_resolution(Self) -> Double = _
fn set_default(Self) -> Unit = _
fn set_resolution(Self, Double) -> Unit = _
}

#
FontMap

pub type FontMap
impl IFontMap for FontMap

#
FontMap::as_pango_font_map

fn FontMap::as_pango_font_map(self : FontMap) ->
FontMap

#
FontMap::get_default

fn FontMap::get_default() -> FontMap

#
FontMap::get_font_type

#
FontMap::get_resolution

fn FontMap::get_resolution(self : FontMap) -> Double

#
FontMap::new

fn FontMap::new() -> FontMap

#
FontMap::new_for_font_type

fn FontMap::new_for_font_type(fonttype :
FontType
) -> FontMap?

#
FontMap::set_default

fn FontMap::set_default(self : FontMap) -> Unit

#
FontMap::set_resolution

fn FontMap::set_resolution(self : FontMap, dpi : Double) -> Unit

#
context_get_resolution

fn context_get_resolution(context : &
IContext
) -> Double

#
context_set_resolution

fn context_set_resolution(context : &
IContext
, dpi : Double) -> Unit

#
error_underline_path

fn error_underline_path(cr :
Context
, x : Double, y : Double, width : Double, height : Double) -> Unit

#
glyph_string_path_range

fn glyph_string_path_range(cr :
Context
, font : &
IFont
, glyphs :
GlyphString
, start : Int, end : Int) -> Bool

Adds glyphs in the half-open range [start, end) to cr's current path.

The glyph positions are relative to Cairo's current point, matching glyph_string_path. An empty range is a successful no-op. Returns false without changing the current path when the range is outside glyphs. A true result means the range was submitted; inspect cr.status() for Cairo drawing errors.

#
show_error_underline

fn show_error_underline(cr :
Context
, x : Double, y : Double, width : Double, height : Double) -> Unit

#
show_glyph_item

fn show_glyph_item(cr :
Context
, text : String, glyph_item :
GlyphItem
) -> Unit

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io