fortplot_tt_curves Module

TrueType glyph outline curve tessellation. Converts quadratic/cubic Bezier curves from glyph outlines into flat line segments suitable for rasterization. Fortran port of stbtt_FlattenCurves and related functions from stb_truetype.h lines 3547-3693.



Derived Types

type, public ::  tt_point_t

Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: x
real(kind=dp), public :: y

Subroutines

public subroutine tt_flatten_curves(vertices, num_verts, objspace_flatness, points, contour_lengths, num_contours)

Convert glyph vertex array to flattened point arrays with contour info. Uses a two-pass algorithm: pass 1 counts points, pass 2 fills them. Port of stbtt_FlattenCurves (stb_truetype.h lines 3618-3693).

Arguments

Type IntentOptional Attributes Name
type(tt_vertex_t), intent(in) :: vertices(:)
integer, intent(in) :: num_verts
real(kind=dp), intent(in) :: objspace_flatness
type(tt_point_t), intent(out), allocatable :: points(:)
integer, intent(out), allocatable :: contour_lengths(:)
integer, intent(out) :: num_contours