microvg  8.0.3
microvg
Data Structures | Functions
vg_outline_box.h File Reference

MicroEJ MicroVG library low level API: box of the curve an outline draws. More...

#include "vg_configuration.h"
#include <stdbool.h>
#include <freetype/ftoutln.h>

Go to the source code of this file.

Data Structures

struct  VG_OUTLINE_BOX
 The box of the curve an outline draws, control points excluded. More...
 

Functions

void VG_OUTLINE_BOX_compute (const FT_Outline *outline, VG_OUTLINE_BOX *box)
 Computes the box of the curve the given outline draws, where the box a font declares also bounds the control points, which the curve never touches. More...
 

Detailed Description

MicroEJ MicroVG library low level API: box of the curve an outline draws.

Author
MicroEJ Developer Team
Version
8.0.3

Definition in file vg_outline_box.h.

Function Documentation

◆ VG_OUTLINE_BOX_compute()

void VG_OUTLINE_BOX_compute ( const FT_Outline *  outline,
VG_OUTLINE_BOX *  box 
)

Computes the box of the curve the given outline draws, where the box a font declares also bounds the control points, which the curve never touches.

The walk relies on FT_Outline_Decompose, which validates nothing: it reports only the malformations it happens to trip over, and an outline whose contour ends past its point array is read past that array and yields an arbitrary box. Passing a well-formed outline is the caller's responsibility; every caller passes an outline FreeType itself produced.

Parameters
[in]outlinethe well-formed outline to measure
[out]boxthe box, zeroed and flagged empty when the outline draws nothing, and when FreeType reports a malformation while walking it