microvg  2.0.0
microvg
Data Structures | Macros | Typedefs | Functions
freetype_bitmap_helper.h File Reference

Freetype bitmap helper implementation header for VectorGraphics Low Level API. More...

#include <stdint.h>
#include <ft2build.h>
#include <freetype/internal/ftobjs.h>
#include <LLVG_FONT_PAINTER_impl.h>
#include <LLVG_FONT_impl.h>

Go to the source code of this file.

Data Structures

struct  Freetype_context_type
 Data structure for pack all the variables required by freetype handler. More...
 
struct  transform_matrix
 

Macros

#define METRICS_DIVISOR   6
 
#define FT_HELPER_X_MIN   0
 
#define FT_HELPER_Y_MIN   0
 
#define FREETYPE_OK   0
 
#define FREETYPE_INTERNAL_ERROR   -1
 
#define FREETYPE_NOT_IMPLEMENTED   -2
 
#define TRANSFORM_MATRIX_POS_X   2
 
#define TRANSFORM_MATRIX_POS_Y   5
 
#define FT_RED_SHIFT   16
 
#define FT_GREEN_SHIFT   8
 
#define FT_BLUE_SHIFT   0
 
#define max(X, Y)   (((X) > (Y)) ? (X) : (Y))
 
#define min(X, Y)   (((X) < (Y)) ? (X) : (Y))
 

Typedefs

typedef struct transform_matrix transform_matrix_t
 

Functions

int ft_helper_print_jstring_clipped (MICROUI_GraphicsContext *gc, Freetype_context_type *freetype_context, jchar *string, jint s_size, jint x, jint y, jint color, jint alpha, jfloat size, jint blend, jfloat letterSpacing)
 Prints a string in a buffer respecting the clipping area of the MicroUI Graphics Context. More...
 
void ft_helper_free (Freetype_context_type *freetype_context)
 Frees all Freetype data context. More...
 

Detailed Description

Freetype bitmap helper implementation header for VectorGraphics Low Level API.

Author
MicroEJ Developer Team
Version
2.0.0

Definition in file freetype_bitmap_helper.h.

Macro Definition Documentation

§ FREETYPE_INTERNAL_ERROR

#define FREETYPE_INTERNAL_ERROR   -1

Error code returned when an error occurred after a call of a freetype function.

Definition at line 44 of file freetype_bitmap_helper.h.

§ FREETYPE_NOT_IMPLEMENTED

#define FREETYPE_NOT_IMPLEMENTED   -2

Error code returned when the function is not implemented.

Definition at line 45 of file freetype_bitmap_helper.h.

§ FREETYPE_OK

#define FREETYPE_OK   0

Error code returned when function execution is successful.

Definition at line 43 of file freetype_bitmap_helper.h.

§ FT_HELPER_X_MIN

#define FT_HELPER_X_MIN   0

The min start x coordinate to draw a glyph.

Definition at line 40 of file freetype_bitmap_helper.h.

§ FT_HELPER_Y_MIN

#define FT_HELPER_Y_MIN   0

The min start y coordinate to draw a glyph.

Definition at line 41 of file freetype_bitmap_helper.h.

§ METRICS_DIVISOR

#define METRICS_DIVISOR   6

The divider coefficient used to pass from 1/64th of pixels unit to pixels unit.

Definition at line 38 of file freetype_bitmap_helper.h.

§ TRANSFORM_MATRIX_POS_X

#define TRANSFORM_MATRIX_POS_X   2

Position of the x coordinate inside the transform matrix when in 1D-array form.

Definition at line 47 of file freetype_bitmap_helper.h.

§ TRANSFORM_MATRIX_POS_Y

#define TRANSFORM_MATRIX_POS_Y   5

Position of the y coordinate inside the transform matrix when in 1D-array form.

Definition at line 48 of file freetype_bitmap_helper.h.

Function Documentation

§ ft_helper_free()

void ft_helper_free ( Freetype_context_type freetype_context)

Frees all Freetype data context.

Parameters
[in]Freetypecontext of the job.

§ ft_helper_print_jstring_clipped()

int ft_helper_print_jstring_clipped ( MICROUI_GraphicsContext *  gc,
Freetype_context_type freetype_context,
jchar *  string,
jint  s_size,
jint  x,
jint  y,
jint  color,
jint  alpha,
jfloat  size,
jint  blend,
jfloat  letterSpacing 
)

Prints a string in a buffer respecting the clipping area of the MicroUI Graphics Context.

Parameters
[in]gcPointer to MicroUI GraphicsContext.
[in]freetype_contextThe Freetype context with font face data.
[in]stringPointer of the string.
[in]s_sizeLenght of the string in characters.
[in]xThe X coordinate in the frame-buffer pointer.
[in]yThe Y coordinate in the frame-buffer pointer.
[in]colorThe 32 bits ARGB color of the string.
[in]alphaThe opacity coefficient.
[in]sizeThe character size.
[in]blendthe blend mode to use
[in]letterSpacingthe extra letter spacing to use
Returns
FREETYPE_OK code if success, otherwise there is an error.