1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
/*
* $Id: thrend.h,v 1.11 2006-08-01 11:46:57 thep Exp $
* thrend.h - Thai string rendering
* Created: 2001-05-17
*/
#ifndef THAI_THREND_H
#define THAI_THREND_H
#include <thai/thailib.h>
#include <thai/thcell.h>
BEGIN_CDECL
/**
* @file thrend.h
* @brief Thai string rendering
*/
/**
* @brief Glyph code type
*/
typedef unsigned char thglyph_t;
/**
* @brief Blank base glyph, for floating upper/lower vowel
*/
#define TH_BLANK_BASE_GLYPH 0xdd
/**
* @brief Render the given cell using TIS-620 glyph set
*
* @param cell : the cell to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from TIS-620 glyph set for the given @a cell,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_cell_tis(struct thcell_t cell,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
/**
* @brief Render the given cell using Thai Windows glyph set
*
* @param cell : the cell to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from Thai Windows glyph set for the given @a cell,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_cell_win(struct thcell_t cell,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
/**
* @brief Render the given cell using Mac Thai glyph set
*
* @param cell : the cell to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from Mac Thai glyph set for the given @a cell,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_cell_mac(struct thcell_t cell,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
/**
* @brief Render the given text using TIS-620 glyph set
*
* @param s : the string to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from TIS-620 glyph set for the given string @a s,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_text_tis(const thchar_t *s,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
/**
* @brief Render the given text using Thai Windows glyph set
*
* @param s : the string to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from Thai Windows glyph set for the given string @a s,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_text_win(const thchar_t *s,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
/**
* @brief Render the given text using Mac Thai glyph set
*
* @param s : the string to render
* @param res : the buffer for storing output glyph string
* @param res_sz : the size of @a res buffer
* @param is_decomp_am : whether SARA AM is to be decomposed into
* NIKHANIT and SARA AA and to be in separate cells
*
* @return total number of glyphs written to @a res[]
*
* Calculates glyphs from Mac Thai glyph set for the given string @a s,
* and store the glyph string in @a res, terminated with '\\0'.
* If resulting glyphs are longer than the provided buffer, only
* the first @a res_sz glyphs are stored.
*/
extern int th_render_text_mac(const thchar_t *s,
thglyph_t res[], size_t res_sz,
int is_decomp_am);
END_CDECL
#endif /* THAI_THREND_H */
|