diff --git a/.gitignore b/.gitignore index ede31ad..080716b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,14 @@ -lib/ -bin/ -debug/ -inc/utsTextSuiteVersion.inc -*.so -*.lps -*.exe -*.res -*.ico -*.dbg -*.dll -*.zip -*.heaptrc -*.heaptrace +lib/ +bin/ +debug/ +inc/utsTextSuiteVersion.inc +*.so +*.lps +*.exe +*.res +*.ico +*.dbg +*.dll +*.zip +*.heaptrc +*.heaptrace diff --git a/.gitmodules b/.gitmodules index ae24a49..0c2a2c9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "src/TextSuite"] - path = src/TextSuite - url = b3rgmann@git.bergmann89.de:opengl/TextSuite.git -[submodule "src/OpenGLCore"] - path = src/OpenGLCore - url = b3rgmann@git.bergmann89.de:opengl/OpenGLCore.git -[submodule "src/Utils"] - path = src/Utils - url = b3rgmann@git.bergmann89.de:freepascal/utils.git +[submodule "src/TextSuite"] + path = src/TextSuite + url = b3rgmann@git.bergmann89.de:opengl/TextSuite.git +[submodule "src/OpenGLCore"] + path = src/OpenGLCore + url = b3rgmann@git.bergmann89.de:opengl/OpenGLCore.git +[submodule "src/Utils"] + path = src/Utils + url = b3rgmann@git.bergmann89.de:freepascal/utils.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..3698306 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Overview + +libTextSuite is a dynamic library that encapsulate the [TextSuite](https://git.bergmann89.de/opengl/TextSuite) project to be able to use it on different platforms and programming languages. Out of the box the following platforms and languages are supported. + +- __supported platforms__ + - i386-win32 + - x64_64-win64 + - i386-linux + - x86_64-linux +- __supported languages__ + - C + - C++ + - C# + - FPC + - (Delphi) + +A detailed [Documentation](./doc/docu.md) is shipped with every copy of libTextSuite. \ No newline at end of file diff --git a/build_release.sh b/build_release.sh index cf2e43b..7d3ae38 100755 --- a/build_release.sh +++ b/build_release.sh @@ -12,6 +12,7 @@ DOCU_DIR="$SCRIPTDIR/doc" INC_MAJOR=false INC_MINOR=false INC_BUGFIX=false +ALLZIPDIR="$SCRIPTDIR/TextSuite-all" if [ -z "$FIRST_VERSION" ]; then FIRST_VERSION="0.0.0.0" @@ -133,7 +134,7 @@ printf "const Version = 'v$NEWVERSION $HASH';" > inc/utsTextSuiteVersion.inc function BuildConfig() { CONFIG=$1 - POSTFIX=$2 + TARGET=$2 FILEEXT=$3 DBGEXT=".dbg" @@ -144,36 +145,47 @@ function BuildConfig() cleaupAndExit 1 fi - ZIPDIR="bin/$POSTFIX" - BINDIR="$ZIPDIR" - ZIPPATH="$SCRIPTDIR/libTextSuite-$POSTFIX.zip" + BINDIR="$SCRIPTDIR/bin" + ZIPDIR="$SCRIPTDIR/TextSuite-$TARGET" + ZIPPATH="$SCRIPTDIR/TextSuite-$TARGET.zip" if [ -n "$TAGNAME" ]; then mkdir -p "$SCRIPTDIR/$TAGNAME/" - ZIPPATH="$SCRIPTDIR/$TAGNAME/libTextSuite-$POSTFIX.zip" + ZIPPATH="$SCRIPTDIR/$TAGNAME/TextSuite-$TARGET.zip" fi - BINNAME="libTextSuite-$POSTFIX$FILEEXT" - DBGNAME="libTextSuite-$POSTFIX$DBGEXT" + TARGETDIR="$BINDIR/$TARGET" + BINNAME="$TARGETDIR/libtextsuite$FILEEXT" + DBGNAME="$TARGETDIR/libtextsuite$DBGEXT" if [ ! -f $BINNAME ]; then - echo "file not found: $EXENAME" + echo "file not found: $BINNAME" cleaupAndExit 2 fi - + + # extract debug infos cp "$BINNAME" "$DBGNAME" || { log "unable to copy binary to *.dbg"; cleaupAndExit 3; } objcopy --only-keep-debug "$DBGNAME" || { log "unable to strip $DBGNAME"; cleaupAndExit 3; } objcopy --strip-debug --strip-unneeded "$BINNAME" || { log "unable to copy binary to $BINNAME"; cleaupAndExit 3; } objcopy --add-gnu-debuglink "$DBGNAME" "$BINNAME" || { log "unable to create debug link"; cleaupAndExit 3; } + + if [ ! -f $DBGNAME ]; then + echo "file not found: $DBGNAME" + cleaupAndExit 2 + fi - mkdir -p $BINDIR - mv "$BINNAME" "$BINDIR/" || { log "unable to copy linked binary"; cleaupAndExit 3; } - mv "$DBGNAME" "$BINDIR/" || { log "unable to copy linked debug infos"; cleaupAndExit 3; } - # use this to copy data folder instead of data archive: cp -R --preserve=links data $BINDIR || { log "unable to copy data folder"; cleaupAndExit 4; } - cp -r "$HEADER_DIR" "$BINDIR" || { log "unable to copy header files"; cleaupAndExit 4; } - cp -r "$DOCU_DIR" "$BINDIR/docu" || { log "unable to copy documentation files"; cleaupAndExit 5; } + # copy header and docu + mkdir -p "$ZIPDIR/bin" + cp -r "$TARGETDIR" "$ZIPDIR/bin" || { log "unable to copy binaries"; cleaupAndExit 3; } + cp -r "$HEADER_DIR" "$ZIPDIR" || { log "unable to copy header files"; cleaupAndExit 4; } + cp -r "$DOCU_DIR" "$ZIPDIR/docu" || { log "unable to copy documentation files"; cleaupAndExit 5; } - pushd $ZIPDIR - rm -rf $ZIPPATH - zip -r $ZIPPATH ./* || { log "unable to create zip archive"; cleaupAndExit 6; } + pushd "$ZIPDIR" + rm -rf "$ZIPPATH" + zip -r "$ZIPPATH" "." || { log "unable to create zip archive"; cleaupAndExit 6; } popd + + mkdir -p "$ALLZIPDIR" + echo "mv $ZIPDIR/* $ALLZIPDIR/" + cp -rf $ZIPDIR/* $ALLZIPDIR/ || { log "unable to copy binaries to all directory"; cleaupAndExit 3; } + rm -rf "$ZIPDIR" } while [[ $# -gt 0 ]]; do @@ -218,5 +230,17 @@ BuildConfig "Win64Release" "x86_64-win64" ".dll" BuildConfig "Linux32Release" "i386-linux" ".so" BuildConfig "Linux64Release" "x86_64-linux" ".so" +ALLZIPPATH="$SCRIPTDIR/TextSuite-all.zip" +if [ -n "$TAGNAME" ]; then + mkdir -p "$SCRIPTDIR/$TAGNAME/" + ALLZIPPATH="$SCRIPTDIR/$TAGNAME/TextSuite-all.zip" +fi + +pushd "$ALLZIPDIR" + rm -rf "$ALLZIPPATH" + zip -r "$ALLZIPPATH" "." || { log "unable to create zip archive"; cleaupAndExit 6; } +popd +rm -rf "$ALLZIPDIR" + cleaupAndExit 0 diff --git a/doc/docu.html b/doc/docu.html new file mode 100644 index 0000000..c9db970 --- /dev/null +++ b/doc/docu.html @@ -0,0 +1,7589 @@ + + + +
+ + +libTextSuite is a library to render text with OpenGl or OpenGLES. The rendered text can be arranged in single lines or text blocks.
+ +Type | +Description | +
---|---|
pointer | +pointer with no data type | +
boolean | +8bit value (zero is FALSE, all other values are TRUE) | +
int8 | +8bit signed integer | +
int16 | +16bit signed integer | +
int32 | +32bit signed integer | +
int64 | +64bit signed integer | +
uint8 | +8bit unsigned integer | +
uint16 | +16bit unsigned integer | +
uint32 | +32bit unsigned integer | +
uint64 | +64bit unsigned integer | +
float | +32bit floating point | +
double | +64bit floating point | +
AnsiChar | +uint8 | +
AnsiString | +pointer to null terminated AnsiChar string | +
WideChar | +uint16 | +
WideString | +pointer to null terminated WideChar string | +
Vector4f | +array with 4 elements of float | +
Matrix4f | +array with 4 elements of Vector4f | +
Handle | +pointer | +
ContextHandle | +pointer | +
RendererHandle | +pointer | +
RenderRefHandle | +pointer | +
TextBlockHandle | +pointer | +
FontCreatorHandle | +pointer | +
FontHandle | +pointer | +
PostProcessorHandle | +pointer | +
ImageHandle | +pointer | +
CharHandle | +pointer | +
ImageModes | +array with 4 elements of ImageMode | +
Pointers to a type are defined as follows: uint16* or WideChar* +
+ +All enumerations are 32bit values!
+ +Name | +Value | +
---|---|
ErrUnknown | +-1 | +
ErrNone | +0 | +
ErrNotInitialized | +1 | +
ErrInvalidEnum | +2 | +
ErrInvalidValue | +3 | +
ErrInvalidOperation | +4 | +
ErrInvalidType | +5 | +
ErrInvalidContextHandle | +100 | +
ErrInvalidRendererHandle | +101 | +
ErrInvalidTextBlockHandle | +102 | +
ErrInvalidFontHandle | +103 | +
ErrInvalidFontCreatorHandle | +104 | +
ErrInvalidImageHandle | +105 | +
ErrInvalidPostProcHandle | +106 | +
Name | +Value | +
---|---|
UTF8 | +0 | +
ISO_8859_1 | +1 | +
ISO_8859_2 | +2 | +
ISO_8859_3 | +3 | +
ISO_8859_4 | +4 | +
ISO_8859_5 | +5 | +
ISO_8859_6 | +6 | +
ISO_8859_7 | +7 | +
ISO_8859_8 | +8 | +
ISO_8859_9 | +9 | +
ISO_8859_10 | +10 | +
ISO_8859_11 | +11 | +
ISO_8859_13 | +12 | +
ISO_8859_14 | +13 | +
ISO_8859_15 | +14 | +
ISO_8859_16 | +15 | +
ISO_037 | +16 | +
ISO_437 | +17 | +
ISO_500 | +18 | +
ISO_737 | +19 | +
ISO_775 | +20 | +
ISO_850 | +21 | +
ISO_852 | +22 | +
ISO_855 | +23 | +
ISO_857 | +24 | +
ISO_860 | +25 | +
ISO_861 | +26 | +
ISO_862 | +27 | +
ISO_863 | +28 | +
ISO_864 | +29 | +
ISO_865 | +30 | +
ISO_866 | +31 | +
ISO_869 | +32 | +
ISO_874 | +33 | +
ISO_875 | +34 | +
ISO_1026 | +35 | +
ISO_1250 | +36 | +
ISO_1251 | +37 | +
ISO_1252 | +38 | +
ISO_1253 | +39 | +
ISO_1254 | +40 | +
ISO_1255 | +41 | +
ISO_1256 | +42 | +
ISO_1257 | +43 | +
ISO_1258 | +44 | +
Name | +Value | +
---|---|
ObjTypeUnknown | +0 | +
ObjTypeContext | +1 | +
ObjTypeRenderer | +2 | +
ObjTypeFontCreator | +3 | +
ObjTypeFont | +4 | +
ObjTypeTextBlock | +5 | +
ObjTypeImage | +6 | +
ObjTypePostProcessor | +7 | +
ObjTypeChar | +8 | +
Name | +Value | +
---|---|
FormatEmpty | +0 | +
FormatRGBA8 | +1 | +
FormatLumAlpha8 | +2 | +
FormatAlpha8 | +3 | +
FormatLum8 | +4 | +
Name | +Value | +
---|---|
RendererUnknown | +0 | +
RendererOpenGL | +1 | +
RendererOpenGLES | +2 | +
Name | +Value | +
---|---|
FontCreatorUnknown | +0 | +
FontCreatorFreeType | +1 | +
FontCreatorGDI | +2 | +
FontCreatorCustom | +3 | +
Name | +Value | +
---|---|
VertAlignTop | +0 | +
VertAlignCenter | +1 | +
VertAlignBottom | +2 | +
Name | +Value | +
---|---|
HorzAlignLeft | +0 | +
HorzAlignCenter | +1 | +
HorzAlignRight | +2 | +
HorzAlignJustify | +3 | +
Name | +Value | +
---|---|
ClipNone | +0 | +
ClipWordBorder | +1 | +
ClipCharBorder | +2 | +
ClipWordComplete | +3 | +
ClipCharComplete | +4 | +
Name | +Value | +
---|---|
None | +0 | +
Normal | +1 | +
Name | +Value | +
---|---|
UsageInclude | +0 | +
UsageExclude | +1 | +
Name | +Value | +
---|---|
StreamOriginBegin | +0 | +
StreamOriginCurrent | +1 | +
StreamOriginEnd | +2 | +
Name | +Value | +
---|---|
ModeIgnore | +0 | +
ModeReplace | +1 | +
ModeModulate | +2 | +
Name | +Bit | +
---|---|
BlockFlagWordWrap | +0 | +
Name | +Bit | +
---|---|
FontStyleBold | +0 | +
FontStyleItalic | +1 | +
FontStyleUnderline | +2 | +
FontStyleStrikeout | +3 | +
Name | +Bit | +
---|---|
ColorChannelRed | +0 | +
ColorChannelGreen | +1 | +
ColorChannelBlue | +2 | +
ColorChannelAlpha | +3 | +
Value | +Type | +
---|---|
X | +int32 | +
Y | +int32 | +
Value | +Type | +
---|---|
TopLeft | +Position | +
BottomRight | +Position | +
OR
+ +Value | +Type | +
---|---|
Left | +int32 | +
Top | +int32 | +
Right | +int32 | +
Bottom | +int32 | +
Value | +Type | +
---|---|
R | +float | +
G | +float | +
B | +float | +
A | +float | +
Value | +Type | +
---|---|
GlyphOrigin | +Position | +
GlyphRect | +Rect | +
Advance | +int32 | +
Value | +Type | +
---|---|
Ascent | +int32 | +
Descent | +int32 | +
ExternalLeading | +int32 | +
BaseLineOffset | +int32 | +
CharSpacing | +int32 | +
LineHeight | +int32 | +
LineSpacing | +int32 | +
Value | +Type | +
---|---|
Size | +int32 | +
Style | +FontStyle | +
AntiAliasing | +AntiAliasing | +
DefaultChar | +WideChar | +
__reserved | +uint16 | +
Ascent | +int32 | +
Descent | +int32 | +
ExternalLeading | +int32 | +
BaseLineOffset | +int32 | +
UnderlinePos | +int32 | +
UnderlineSize | +int32 | +
StrikeoutPos | +int32 | +
StrikeoutSize | +int32 | +
Value | +Type | +
---|---|
StreamRead | +StreamReadCallback | +
StreamSeek | +StreamSeekCallback | +
Value | +Type | +
---|---|
UserArgs | +pointer | +
Execute | +PostProcessorExecuteCallback | +
Value | +Type | +
---|---|
UserArgs | +pointer | +
BeginRender | +RendererBeginRenderCallback | +
EndRender | +RendererEndRenderCallback | +
GetDrawPos | +RendererGetDrawPosCallback | +
SetDrawPos | +RendererSetDrawPosCallback | +
MoveDrawPos | +RendererMoveDrawPosCallback | +
SetColor | +RendererSetColorCallback | +
Render | +RendererRenderCallback | +
CreateRef | +RendererCreateRefCallback | +
FreeRef | +RendererFreeRefCallback | +
All callbacks use the stdcall calling convention!
+ +Read data from stream.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +UserArgs | +pointer | +user arguments | +
+ | Buffer | +pointer | +buffer to store read data in | +
+ | Size | +int32 | +number of bytes stored in buffer | +
+ Returns + | ++ | int32 | +number of read bytes | +
Seek position in stream.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +UserArgs | +pointer | +user arguments | +
+ | Origin | +StreamOrigin | +origin to apply offset at | +
+ | Offset | +int32 | +number of bytes to move | +
+ Returns + | ++ | int32 | +stream position after seek | +
Execute the post processor.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +CharHandle | +CharHandle | +Handle of char to apply post processor at | +
+ | ImageHandle | +ImageHandle | +Handle of image to apply post processor at | +
Begin rendering.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +UserArgs | +pointer | +User defined arguments | +
End rendering.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +UserArgs | +pointer | +User defined arguments | +
Get the current draw position.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +UserArgs | +pointer | +User defined arguments | +
+ Returns + | ++ | Position | +Current draw position | +
Set the current draw position.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Position | +Position | +New draw positionments | +
+ | UserArgs | +pointer | +User defined arguments | +
Move the draw position relative to the current position.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Offset | +Position | +Offset to current position | +
+ | UserArgs | +pointer | +User defined arguments | +
Set the current color.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Color | +Color | +New color | +
+ | UserArgs | +pointer | +User defined arguments | +
Render the given reference. If ForcedWidth is not eqal zero, then render the reference with the given width. This is used for rendereing spaces when the text block uses justify as horizontal alignment.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Reference | +RenderRefHandle | +Handle of reference to render | +
+ | ForcedWidth | +int32 | +Forced width of rendered reference. Use default width if zero. | +
+ | UserArgs | +pointer | +User defined arguments | +
Create a new render reference for the given char and image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +CharHandle | +CharHandle | +Handle of char to create reference for | +
+ | ImageHandle | +ImageHandle | +Handle of image to create reference for | +
+ | UserArgs | +pointer | +User defined arguments | +
+ Returns + | ++ | RenderRefHandle | +Current draw position | +
Destroy the given render reference.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +RenderRef | +RenderRefHandle | +Handle of render reference to destroy | +
+ | UserArgs | +pointer | +User defined arguments | +
Fill the given image pixel with a color.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to fill with data | +
+ | x | +int32 | +Horizontal pixel position | +
+ | y | +int32 | +Vertical pixel position | +
+ | Pixel | +Color | +New color of pixel at (x,y) | +
+ | UserArgs | +pointer | +User defined arguments | +
Merge the to given colors to a new color.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to merge to | +
+ | Source | +Color | +Color of soure image | +
+ | Dest | +Color | +Color of destination image | +
+ | Result | +Color | +New color of destination image | +
+ | UserArgs | +pointer | +User defined arguments | +
Index | +Value | +
---|---|
0 | +ModeReplace | +
1 | +ModeReplace | +
2 | +ModeReplace | +
3 | +ModeReplace | +
Index | +Value | +
---|---|
0 | +ModeReplace | +
1 | +ModeReplace | +
2 | +ModeReplace | +
3 | +ModeModulate | +
Index | +Value | +
---|---|
0 | +ModeModulate | +
1 | +ModeModulate | +
2 | +ModeModulate | +
3 | +ModeModulate | +
Bit | +Is set? | +
---|---|
ColorChannelRed | +yes | +
ColorChannelGreen | +yes | +
ColorChannelBlue | +yes | +
ColorChannelAlpha | +no | +
Bit | +Is set? | +
---|---|
ColorChannelRed | +yes | +
ColorChannelGreen | +yes | +
ColorChannelBlue | +yes | +
ColorChannelAlpha | +yes | +
All callbacks use the stdcall calling convention!
+ +Function that are used to initialize or control the library.
+ +Initializes the internal library variables. must be called once before using any other function!
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | ErrorCode | +Error code | +
Get the version of the library as string.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | AnsiString | +Version of the library as string. | +
Get the last error code that was raised.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | ErrorCode | +Error code of last failed action. | +
Get the last error message as string.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | AnsiString | +Last error message as string | +
Cleans up internal library variables. Should be called once before program exits!
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | ErrorCode | +Error code | +
The context is a wrapper object that owns all created objects. When you delete the context, all assigned objects will destroyed too. You should create only one context in your application.
+ +Create a new context object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Returns + | ++ | ContextHandle | +Handle of created context or NULL on failure (check ltsGetLastErrorCode for details). | +
Get the current code page.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of the context to get the code page for. | +
+ | Value | +CodePage* | +Current code page | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the default char of a context. The default char is used when ever a char could not be displayed correctly. The default value is '?'.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of the context to get the default char for | +
+ | Value | +WideChar* | +Current default char | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the code page of a context.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to set the code page for | +
+ | Value | +CodePage | +New code page | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the default char of a context.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to set default char for | +
+ | Value | +WideChar | +New default char | +
+ Returns + | ++ | ErrorCode | +Error code | +
Convert a AnsiString to a WideString using the contexts code page and default char.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to use for convertion | +
+ | Text | +AnsiString | +Text to convert to WideString | +
+ Returns + | ++ | WideString | +Converted string or NULL on Error (Check ltsGetLastErrorCode for details) | +
Destroy a context object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Renderers are objects to display text on the screen. You are able to decide which API you want to use for rendering. Out of the box OpenGL and OpenGLES is supported, but you are free to create your own renderer.
+ +Create a new renderer.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create renderer for | +
+ | Type | +RendererType | +Type of renderer to create | +
+ | Format | +Format | +Format to use for renderer | +
+ Returns + | ++ | RendererHandle | +Handle of created renderer or NULL in failure (check ltsGetLastErrorCode for details) | +
Create a custom renderer.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create renderer for | +
+ | Format | +Format | +Format of the renderer | +
+ | Data | +CustomRendererData | +Needed data for the custom render context | +
+ Returns + | ++ | RendererHandle | +Handle of the created renderer or NULL in failure (Check ltsGetLastErrorCode for details) | +
Begin a new text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer to create text block for | +
+ | Top | +int32 | +Horizontal position of the text block | +
+ | Left | +int32 | +Vertical position of the text block | +
+ | Width | +int32 | +Width of the text block | +
+ | Height | +int32 | +Height of the text block | +
+ | Flags | +TextBlockFlags | +Text block flags | +
+ Returns + | ++ | TextBlockHandle | +Handle of the created text bolc or NULL on failure (Check ltsGetLastErrorCode for details) | +
Close text block and render it's content. The text block object will be destroyed.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer | +
+ | TextBlock | +TextBlockHandle | +Handle of text block to close | +
+ Returns + | ++ | ErrorCode | +Error code | +
Close text block and do not render it's content. The text block object will be destroyed.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer | +
+ | TextBlock | +TextBlockHandle | +Handle of text block to close | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get width of a given text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer | +
+ | Font | +FontHandle | +Handle of font to use for the text | +
+ | Text | +AnsiString | +Text to get width for | +
+ Returns + | ++ | int32 | +Width of text of -1 on failure (Check ltsGetLastErrorCode for details) | +
Get width of a given text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer | +
+ | Font | +FontHandle | +Handle of font to use for the text | +
+ | Text | +WideString | +Text to get width for | +
+ Returns + | ++ | int32 | +Width of text of -1 on failure (Check ltsGetLastErrorCode for details) | +
Destroy a renderer object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Renderer | +RendererHandle | +Handle of renderer to destroy. | +
+ Returns + | ++ | ErrorCode | +Error code | +
Font creators are objects that are used load glyphs for a certain char. Out of the box a GDI and a FreeType font creator are supported, but you are free to write your own one.
+ +Create a new font creator object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create font creator for | +
+ | Type | +FontCreatorType | +Type of font creator to create | +
+ Returns + | ++ | FontCreatorHandle | +Handle of created font creator or NULL on failure (Check ltsGetLastErrorCode for details) | +
Load a font by its name.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +FontCreator | +FontCreatorHandle | +Handle of font creator to create font with | +
+ | Fontname | +AnsiString | +Name of the font to create | +
+ | Size | +int32 | +Size of the font to create | +
+ | Style | +FontStyle | +Style of the font to create | +
+ | AnsiAliasing | +AntiAliasing | +Anti aliasing of the font to create | +
+ Returns + | ++ | FontHandle | +Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details) | +
Load a font from a file.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +FontCreator | +FontCreatorHandle | +Handle of font creator to create font with | +
+ | Filename | +AnsiString | +Filename to load font from | +
+ | Size | +int32 | +Size of the font to create | +
+ | Style | +FontStyle | +Style of the font to create | +
+ | AnsiAliasing | +AntiAliasing | +Anti aliasing of the font to create | +
+ Returns + | ++ | FontHandle | +Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details) | +
Load a font from a stream.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +FontCreator | +FontCreatorHandle | +Handle of font creator to create font with | +
+ | Stream | +StreamData* | +libTextSuite stream interface | +
+ | Size | +int32 | +Size of the font to create | +
+ | Style | +FontStyle | +Style of the font to create | +
+ | AnsiAliasing | +AntiAliasing | +Anti aliasing of the font to create | +
+ Returns + | ++ | FontHandle | +Handle of created font or NULL on failue (Check ltsGetLastErrorCode for details) | +
Destroy a font creator object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +FontCreator | +FontCreatorHandle | +Handle of font creator to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Font objects are used to define the appearance (size, style, ...) of text. They are created using a font creator.
+ +Get the current post processor object assigned to a font.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the post processor for | +
+ Returns + | ++ | PostProcessorHandle | +Handle of post processor assigned to this font. | +
Get the current tab width of a font.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get tab width for | +
+ | Value | +int32* | +Tab width of font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the current char spacing of a font.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get char spacing for | +
+ | Value | +int32* | +Char spacing of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the current line spacing of a font.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get line spacing for | +
+ | Value | +int32* | +Line spacing of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the metric of a font.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get metric for | +
+ | Value | +FontMetric* | +Metric of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the name of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the name for | +
+ Returns + | ++ | AnsiString | +Font name or NULL on failure (Check ltsGetLastErrorCode for details) | +
Get the face name of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the face name for | +
+ Returns + | ++ | AnsiString | +Face name or NULL on failure (Check ltsGetLastErrorCode for details) | +
Get the style name of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the style name for | +
+ Returns + | ++ | AnsiString | +Style name or NULL on failure (Check ltsGetLastErrorCode for details) | +
Get the full name of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the full name for | +
+ Returns + | ++ | AnsiString | +Full name or NULL on failure (Check ltsGetLastErrorCode for details) | +
Get the copyright of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to get the copyright for | +
+ Returns + | ++ | AnsiString | +Copyright or NULL on failure (Check ltsGetLastErrorCode for details) | +
Set the post processor of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to set the post processor for | +
+ | PostProcessor | +PostProcessorHandle | +Handle of post processor to assign to the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the tab width of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to set the tab width for | +
+ | Value | +int32* | +New tab width of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the char spacing of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to set the char spacing for | +
+ | Value | +int32* | +New char spacing of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the line spacing of a font
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to set the line spacing for | +
+ | Value | +int32* | +New line spacing of the font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Destroy a font object
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Font | +FontHandle | +Handle of font to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Text block objects are used to arrange text in a block: automatic line break, alignment, text color, text font, ...
+ +Get the rect of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the rect for | +
+ | Value | +Rect* | +Rect of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the width of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the width for | +
+ | Value | +int32* | +Width of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the height of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the height for | +
+ | Value | +int32* | +Height of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the flags of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the flags for | +
+ | Value | +TextBlockFlags* | +Flags of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the vertical position of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get vertical position for | +
+ | Value | +int32* | +Vertical position of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the horizontal position of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get horizontal position for | +
+ | Value | +int32* | +Horizontal position of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the vertical alignment of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get vertical alignment for | +
+ | Value | +VerticalAlign* | +Vertical alignment of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the horizontal alignment of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get horizontal alignment for | +
+ | Value | +HorizontalAlign* | +Horizontal alignment of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the clipping of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the clipping for | +
+ | Value | +Clipping* | +Clipping of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the current color of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the color for | +
+ | Value | +Color* | +Current color of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the current font of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the font for | +
+ | Value | +FontHandle* | +Current font of the text block | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the vertical position of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the vertical position for | +
+ | Value | +int32 | +New vertical position | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the horizontal position of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the horizontal position for | +
+ | Value | +int32 | +New horizontal position | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the vertical alignment of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the vertical alignment for | +
+ | Value | +VerticalAlign | +New vertical alignment | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the horizontal alignment of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the horizontal alignment for | +
+ | Value | +HorizontalAlign | +New horizontal alignment | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the clipping of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the clipping for | +
+ | Value | +Clipping | +New clipping | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the color of a text block. This will not affect already written Text!
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the color for | +
+ | Value | +Color | +New color | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the font of a text block. This will not affect already written text!
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to set the font for | +
+ | Value | +FontHandle | +New font | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the actual used height of a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the actual height for | +
+ Returns + | ++ | int32 | +Actual height of the text block or -1 on failure (Chec ltsGetLastErrorCode for more details) | +
Get the width of a text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the text width for | +
+ | Text | +AnsiText | +Text to get the width for | +
+ Returns + | ++ | int32 | +Text width or -1 on failure (Chec ltsGetLastErrorCode for more details) | +
Get the width of a text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the text width for | +
+ | Text | +WideText | +Text to get the width for | +
+ Returns + | ++ | int32 | +Text width or -1 on failure (Chec ltsGetLastErrorCode for more details) | +
Write text to the text block. This will use the current color and the current font of the text block. A change of the color or the font will not take effect on already written text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the text width for | +
+ | Text | +AnsiText | +Text to get the width for | +
+ Returns + | ++ | ErrorCode | +Error code | +
Write text to the text block. This will use the current color and the current font of the text block. A change of the color or the font will not take effect on already written text.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to get the text width for | +
+ | Text | +WideText | +Text to get the width for | +
+ Returns + | ++ | ErrorCode | +Error code | +
Destroy a text block.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +TextBlock | +TextBlockHandle | +Handle of text block to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Image objects are used to store glyph data. You can manipulate the stored data through a post processor before the glyph is rendered.
+ +Create a new image object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create the image for | +
+ Returns + | ++ | ImageHandle | +Handle of created image or NULL on failure (Check ltsGetLastErrorCode for details) | +
Check is an image is empty.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to check | +
+ | Value | +boolean | +TRUE if the image is empty, FALSE otherwise | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the width of an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get width for | +
+ Returns + | ++ | int32 | +Width of image or -1 on failure (Check ltsGetLastErrorCode for details) | +
Get the height of an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get height for | +
+ Returns + | ++ | int32 | +Height of image or -1 on failure (Check ltsGetLastErrorCode for details) | +
Get the number of bytes used in each line of an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get line size for | +
+ Returns + | ++ | int32 | +Line size of image or -1 on failure (Check ltsGetLastErrorCode for details) | +
Get the number of bytes used to store the images data.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get data size for | +
+ Returns + | ++ | int32 | +Data size of image or -1 on failure (Check ltsGetLastErrorCode for details) | +
Get the format of an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get the format for | +
+ | Format | +Format* | +Format of the image | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the raw data of an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get the data for | +
+ Returns + | ++ | pointer | +Pointer to image data or NULL on failure (Check ltsGetLastErrorCode for more details) | +
Get the raw data of a line inside of the image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get the scanline for | +
+ | Index | +int32 | +Index of the scanline | +
+ Returns + | ++ | pointer | +Pointer to scanline data or NULL on failure (Check ltsGetLastErrorCode for more details) | +
Get the color of a pixel inside the image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to get pixel color for | +
+ | X | +int32 | +Horizontal pixel position | +
+ | Y | +int32 | +Vertical pixel position | +
+ | Color | +Color* | +Pixel color | +
+ Returns + | ++ | ErrorCode | +Error code | +
Copy one image to another.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to assign Source to | +
+ | Source | +ImageHandle | +Handle of image to copy to Image | +
+ | Color | +Color* | +Pixel color | +
+ Returns + | ++ | ErrorCode | +Error code | +
Clear image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to clear | +
+ | Format | +Format | +Format of image data | +
+ | Width | +int32 | +Width of image | +
+ | Height | +int32 | +Height of image | +
+ Returns + | ++ | ErrorCode | +Error code | +
Load image data using a callback function.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to load data for | +
+ | Callback | +ImageLoadCallback | +Callback to load image data | +
+ | UserArgs | +pointer | +User defined arguments the will passed to the callback | +
+ Returns + | ++ | ErrorCode | +Error code | +
Resize an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to resize | +
+ | Width | +int32 | +New width of the image | +
+ | Height | +int32 | +New height of the image | +
+ | X | +int32 | +Horizontal position of the old image inside the new one | +
+ | Y | +int32 | +Vertical position of the old image inside the new one | +
+ Returns + | ++ | ErrorCode | +Error code | +
Fill image with given color.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to fill with color | +
+ | Color | +Color | +Color to fill image with | +
+ | Mask | +ColorChannels | +Color channels the action will take effect on | +
+ | Modes | +ImageModes | +Modes how the action will take effect on | +
+ Returns + | ++ | ErrorCode | +Error code | +
Fill image with given pattern.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to fill with pattern | +
+ | Pattern | +ImageHandle | +Handle of image to use as pattern | +
+ | X | +int32 | +Horizontal position the pattern will be placed at | +
+ | Y | +int32 | +Vertical position the pattern will be placed at | +
+ | Mask | +ColorChannels | +Color channels the action will take effect on | +
+ | Modes | +ImageModes | +Modes how the action will take effect on | +
+ Returns + | ++ | ErrorCode | +Error code | +
Blend an image into another image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to blend other image in | +
+ | Source | +ImageHandle | +Handle of image to blend into Image | +
+ | X | +int32 | +Horizontal position the source image will be placed at | +
+ | Y | +int32 | +Vertical position the source image will be placed at | +
+ | BlendFunc | +ImageBlendCallback | +Callback to handle blending | +
+ | UserArgs | +pointer | +User defined argument that will be passed to callback | +
+ Returns + | ++ | ErrorCode | +Error code | +
Blur an image.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to blur | +
+ | HorzRadius | +float | +Horizontal blur radius | +
+ | HorzStrength | +float | +Horizontal blur strength | +
+ | VertRadius | +float | +Vertical blur radius | +
+ | VertStrength | +float | +Vertical blur strength | +
+ | Mask | +ColorChannels | +Color channels this action will take effect on | +
+ Returns + | ++ | ErrorCode | +Error code | +
Destroy an image object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Image | +ImageHandle | +Handle of image to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Post processor objects are used to manipulate glyph data before it is rendered. You are able to add shadows, borders or something like that.
+ +Create a fill color post processor
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create post processor for | +
+ | Color | +Color | +Color to use for fill | +
+ | Modes | +ImageModes | +Modes how the action will take effect on | +
+ | Channels | +ColorChannels | +Color channels the action will take effect on | +
+ Returns + | ++ | PostProcessorHandle | +Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail) | +
Create a fill pattern post processor
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create post processor for | +
+ | Pattern | +ImageHandle | +Handle to image to use as pattern | +
+ | OwnsPattern | +boolean | +TRUE: Pattern image will be destroyed with post processor; FALSE: Pattern image will not be destroyed | +
+ | Position | +Position | +Position the pattern will be placed | +
+ | Modes | +ImageModes | +Modes how the action will take effect on | +
+ | Channels | +ColorChannels | +Color channels the action will take effect on | +
+ Returns + | ++ | PostProcessorHandle | +Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail) | +
Create a border post processor
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create post processor for | +
+ | Width | +float | +Width of the created border | +
+ | Strength | +float | +Strength of the created border | +
+ | Color | +Color | +Color of the created border | +
+ | KeepSize | +boolean | +TRUE: do not resize the glyph image; FALSE: resize the glyph image | +
+ Returns + | ++ | PostProcessorHandle | +Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail) | +
Create a shadow post processor
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create post processor for | +
+ | Width | +float | +Width of the created shadow | +
+ | Strength | +float | +Strength of the created shadow | +
+ | Offset | +Position | +Offset of the created shadow | +
+ | Color | +Color | +Color of the created shadow | +
+ Returns + | ++ | PostProcessorHandle | +Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail) | +
Create a custom post processor
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Context | +ContextHandle | +Handle of context to create post processor for | +
+ | Data | +CustomPostProcessorData* | +libTextSuite custom post processor interface | +
+ Returns + | ++ | PostProcessorHandle | +Handle of created post processor or NULL on failure (Check ltsGetLastErrorCode for more detail) | +
Add range of characters the post processor will take effect on.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +PostProcessor | +PostProcessorHandle | +Handle of post processor to add char range to | +
+ | Usage | +RangeUsage | +Usage of the passed char range | +
+ | Start | +WideChar | +First char of range | +
+ | Stop | +WideChar | +Last char of range | +
+ Returns + | ++ | ErrorCode | +Error code | +
Add characters the post processor will take effect on.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +PostProcessor | +PostProcessorHandle | +Handle of post processor to add chars to | +
+ | Usage | +RangeUsage | +Usage of the passed char range | +
+ | Chars | +WideString | +Characters to add | +
+ Returns + | ++ | ErrorCode | +Error code | +
Clear all character defines of a post processor.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +PostProcessor | +PostProcessorHandle | +Handle of post processor to clear | +
+ Returns + | ++ | ErrorCode | +Error code | +
Execute the post processor.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +PostProcessor | +PostProcessorHandle | +Handle of post processor to execute | +
+ | Char | +CharHandle | +Handle of char to execute the post processor on | +
+ | Image | +ImageHandle | +Handle of image to execute the post processor on | +
+ Returns + | ++ | ErrorCode | +Error code | +
Destroy a post processor object.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +PostProcessor | +PostProcessorHandle | +Handle of post processor to destroy | +
+ Returns + | ++ | ErrorCode | +Error code | +
Char objects are used to store the size of a glyph. The data can be manipulated using a post processor.
+ +Get the char code the char object is assigned to.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Char | +CharHandle | +Handle to char to get char code for | +
+ | Value | +WideChar* | +Char code of the char object is assigned to | +
+ Returns + | ++ | ErrorCode | +Error code | +
Get the glyph metric of a char.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Char | +CharHandle | +Handle to char to get glyph metric for | +
+ | Value | +GlyphMetric* | +Glyph metric of the char object | +
+ Returns + | ++ | ErrorCode | +Error code | +
Set the glyph metric of a char.
+ ++ | Name | +Type | +Description | +
---|---|---|---|
+ Parameters + | +Char | +CharHandle | +Handle to char to get glyph metric for | +
+ | Value | +GlyphMetric* | +New glyph metric | +
+ Returns + | ++ | ErrorCode | +Error code | +
libTextSuite is a library to render text with OpenGl or OpenGLES. The rendered text can be arranged in single lines or text blocks.
-All api functions use the stdcall calling convention!
-pointer | -pointer with no data type | -
boolean | -8bit value (zero is FALSE, all other values are TRUE) | -
int8 | -8bit signed integer | -
int16 | -16bit signed integer | -
int32 | -32bit signed integer | -
int64 | -64bit signed integer | -
uint8 | -8bit unsigned integer | -
uint16 | -16bit unsigned integer | -
uint32 | -32bit unsigned integer | -
uint64 | -64bit unsigned integer | -
float | -32bit floating point | -
double | -64bit floating point | -
AnsiChar | -uint8 | -
AnsiString | -pointer to null terminated AnsiChar string | -
WideChar | -uint16 | -
WideString | -pointer to null terminated WideChar string | -
Function that are used to initialize or control the library.
- -initializes the internal library variables. must be called once before using any other function
- returns -uint32error code
-returns the last error code of the last raised error. the error code will not be reseted after the call.
- returns -uint32error code
-returns the error message of the last raised error
- returns -AnsiStringerror message
-cleans up internal library variables. should be called once before program exits
- returns -uint32error code
-The context is a wrapper object that owns all created objects. When you delete the context, all assigned objects will destroyed also.
- -creates a new context handle
- returns -pointercontext handle or NULL on failure
-get the current code page of a context
- parameters -pointercontext handle
-pointer to uint32value to fill with current code page
- returns -uint32error code
-get the current default char of a context
- parameters -pointercontext handle
-WideCharvalue to fill with current default char
- returns -uint32error code
-set the code page of a context
- parameters -pointercontext handle
-uint32new code page value
- return -uint32error code
-set the default char of a context
- parameters -pointercontext handle
-WideCharnew default char value
- returns -uint32error code
-convert an AnsiString to a WideString
- parameters -pointercontext handle
-AnsiStringstring to convert
- returns -WideStringconverted string or NULL on failure
-destroy a context handle
- parameters -pointercontext handle
- returns -uint32error code
-Renderers are objects to display text on the screen. You are able to decide which API you want to use for rendering. Out of the box OpenGL and OpenGLES is supported, but you are free to create your own renderer.
- -create a new renderer
- parameters -pointercontext handle
-uint32type of renderer (see RenderType constants)
-uint32texture format (see Format constants)
- returns -pointerrenderer handle or NULL on failure
-create a new custom renderer that can be controlled by the user
- parameters -pointercontext handle
-uint32texture format (see Format constants)
-pointer to RendererCustomDatadata of custom renderer (RendererCustomData data type)
- returns -pointerrenderer handle or NULL on failure
-begin a new text block
- parameters -pointerrenderer handle
-int32top of text block
-int32left of text block
-int32width of text block
-int32height of text block
-uint32text block flags (see TextBlockFlags constants)
- returns -pointertext block handle
-finish a text block and draw the assigned text
- parameters -pointerrenderer handle
-pointertext block handle
- returns -uint32error code
-finish a text block but does not draw the assigned text
- parameters -pointerrenderer handle
-pointertext block handle
- returns -uint32error code
-calculate the size of a certain string
- parameters -pointerrenderer handle
-pointerfont handle to use for rendering text
-AnsiStringstring to calculate width for
- returns -int32width of the given text or -1 on failure
-calculate the size of a certain string
- parameters -pointerrenderer handle
-pointerfont handle to use for rendering text
-WideStringstring to calculate width for
- returns -int32width of the given text or -1 on failure
-destroy a renderer handle
- parameters -pointerrenderer handle to destroy
- returns -uint32error code
-Font creators are objects that will load glyphs for a certain char. Out of the box a GDI and a FreeType font creator are supported, but you are free to write your own one.
- -creates a new font creator handle
- parameters -pointercontext handle
-uint32type of font creator to create (see FontCreatorType constants)
- returns -pointerhandle to new font creator or NULL on failure
-create a font handle using the name of the font
- parameters -pointerfont creator handle
-AnsiStringname of the font
-int32font size
-uint32font style flags (see FontStyleFlag constants)
-uint32font anti aliasing (see FontAntiAliasing constants)
- returns -pointerfont handle or NULL on failure
-create a font handle using a font file
- parameters -pointerfont creator handle
-AnsiStringfile name of the font file
-int32font size
-uint32font style flags (see FontStyleFlag constants)
-uint32font anti aliasing (see FontAntiAliasing constants)
- returns -pointerfont handle or NULL on failure
-create a font handle using a data stream
- parameters -pointerfont creator handle
-pointer to Streamstream to load font from (see Stream data type)
-int32font size
-uint32font style flags (see FontStyleFlag constants)
-uint32font anti aliasing (see FontAntiAliasing constants)
- returns -pointerfont handle or NULL on failure
-destroy a font creator
- parameters -pointerfont creator handle to destroy
- returns -uint32error code
-Font objects are used to define the appearance (size, style, ...) of text. They are created using a font creator.
- -get the current post processor of a font
- parameters -pointerfont handle
- returns -pointercurrent assigned post processor
-get the current tab with of a font
- parameters -pointerfont handle
-pointer to int32value to write current tab width to
- returns -uint32error code
-get the current char spacing of a font
- parameters -pointerfont handle
-pointer to int32value to write current char spacing to
- returns -uint32error code
-get the current line spacing of a font
- parameters -pointerfont handle
-pointer to floatvalue to write current line spacing to
- returns -uint32error code
-get the metric of a font
- parameters -pointerfont handle
-pointer to FontMetricvalue to write font metric to (see FontMetric data type)
- returns -uint32error code
-get name of a font
- parameters -pointerfont handle
- returns -AnsiStringfont name or NULL on failure
-get face name of a font
- parameters -pointerfont handle
- returns -AnsiStringface name or NULL on failure
-get style name of a font
- parameters -pointerfont handle
- returns -AnsiStringstyle name or NULL on failure
-get full name of a font
- parameters -pointerfont handle
- returns -AnsiStringfull name or NULL on failure
-get copyright of a font
- parameters -pointerfont handle
- returns -AnsiStringcopyright or NULL on failure
-set post processor of a font
- parameters -pointerfont handle
-pointerpost processor handle
- returns -uint32error code
-set tab with of a font
- parameters -pointerfont handle
-int32new tab with value
- returns -uint32error code
-set char spacing of a font
- parameters -pointerfont handle
-int32new char spacing value
- returns -uint32error code
-set line spacing of a font
- parameters -pointerfont handle
-floatnew line spacing value
- returns -uint32error code
-destroy a font handle
- parameters -pointerfont handle to destroy
- returns -uint32error code
-Text block objects are used to arrange text in a block: automatic line break, alignment, text color, text font, ...
- -get text block rectangle
- parameters -pointertext block handle
-pointer to Rectvalue to store text block rectangle in
- returns -uint32error code
-get the width of a text block
- parameters -pointertext block handle
-pointer to int32value to write text block width to
- returns -uint32error code
-get the height of a text block
- parameters -pointertext block handle
-pointer to int32value to write text block height to
- returns -uint32error code
-get text block flags
- parameters -pointertext block handle
-pointer to int32value to write text block flags to (see TextBlockFlags constants)
- returns -uint32error code
-get the top position of a text block
- parameters -pointertext block handle
-pointer to int32value to write text block top position to
- returns -uint32error code
-get the left position of a text block
- parameters -pointertext block handle
-pointer to int32value to write text block left position to
- returns -uint32error code
-get the vertical alignment of a text block
- parameters -pointertext block handle
-pointer to int32value to write vertical alignment to (see VertAlignment constants)
- returns -uint32error code
-get the horizontal alignment of a text block
- parameters -pointertext block handle
-pointer to int32value to write horizontal alignment to (see HorzAlignment constants)
- returns -uint32error code
-get the clipping value of a text block
- parameters -pointertext block handle
-pointer to int32value to write clipping to (see TextBlockClipping constants)
- returns -uint32error code
-get the current color of a text block
- parameters -pointertext block handle
-pointer to Colorvalue to write color to (see Color data type)
- returns -uint32error code
-get the current font handle of a text block
- parameters -pointertext block handle
-pointer to pointervalue to write font handle to
- returns -uint32error code
-set the top position of a text block
- parameters -pointertext block handle
-int32new value for top position
- returns -uint32error code
-set the left position of a text block
- parameters -pointertext block handle
-int32new value for left position
- returns -uint32error code
-set the vertical alignment of a text block
- parameters -pointertext block handle
-int32new value for vertical alignment (see VertAlignment constants)
- returns -uint32error code
-set the horizontal alignment of a text block
- parameters -pointertext block handle
-int32new value for horizontal alignment (see HorzAlignment constants)
- returns -uint32error code
-set the a text block clipping
- parameters -pointertext block handle
-int32new value for text block clipping (see TextBlockClipping constants)
- returns -uint32error code
-set color to render text with
- parameters -pointertext block handle
-int32new value for text color (see Color data type)
- returns -uint32error code
-set font to render text with
- parameters -pointertext block handle
-pointerfont handle
- returns -uint32error code
-get the used size of a text block
- parameters -pointertext block handle
- returns -int32actual used size of the text block or -1 on error
-get the width of a certain text
- parameters -pointertext block handle
-AnsiStringstring to calculate width for
- returns -int32width of the passed text or -1 on error
-get the width of a certain text
- parameters -pointertext block handle
-WideStringstring to calculate width for
- returns -int32width of the passed text or -1 on error
-write text to the text block using the current font and color
- parameters -pointertext block handle
-AnsiStringtext to write to text block
- returns -uint32error code
-write text to the text block using the current font and color
- parameters -pointertext block handle
-WideStringtext to write to text block
- returns -uint32error code
-destroy a text block
- parameters -pointertext block handle
- returns -uint32error code
-Image objects are used to store glyph data. You can manipulate the stored data through a post processor before the glyph is rendered.
- -create a new image
- parameters -pointercontext handle
- returns -pointerimage handle or NULL on error
-check if an image is empty
- parameters -pointerimage handle
-pointer to booleanvalue to write result to
- returns -uint32error code
-get the width of an image
- parameters -pointerimage handle
- returns -int32image width or -1 on error
-get the height of an image
- parameters -pointerimage handle
- returns -int32image height or -1 on error
-get the data size of a single line (in bytes)
- parameters -pointerimage handle
- returns -int32line size or -1 on error
-get the data size of the complete image (in bytes)
- parameters -pointerimage handle
- returns -int32data size or -1 on error
-get the format of an image
- parameters -pointerimage handle
-pointer to int32value to write image format to (see ImageFormat constants)
- returns -uint32error code
-get a pointer to the image data
- parameters -pointerimage handle
- returns -pointerpointer to the image data or NULL on failure
-get a pointer to a certain image line
- parameters -pointerimage handle
-int32line index
- returns -pointerpointer to the image line or NULL on failure
-get the color of a single pixel
- parameters -pointerimage handle
-int32x position
-int32y position
-pointer to Colorvalue to write color to (see Color data type)
- returns -uint32error code
-assign the source image to another image (duplicate the image object)
- parameters -pointerimage handle
-pointerimage handle of source image
- returns -uint32error code
-initialize image with a certain size and format
- parameters -pointerimage handle
-ImageFormatdata format of the image (see ImageFormat constants)
-int32width of the image (in pixel)
-int32height of the image (in pixel)
- returns -uint32error code
-load image data from callback function
- parameters -pointerimage handle
-ImageLoadFunccallback function (see ImageLoadFunc data type)
-pointeruser defined arguments (will passed to callback function)
- returns -uint32error code
-change the size of an image
- parameters -pointerimage handle
-int32new image width
-int32new image height
-int32x position of the old image inside the new one
-int32y position of the old image inside the new one
- returns -uint32error code
-fill the complete image with a color
- parameters -pointerimage handle
-Colorcolor to fill image with (see Color data type)
-uint32flags of color channel to fill (see ColorChannels constants)
-ImageModesimage mode to use for color fill (see ImageModes data type)
- returns -uint32error code
-fill the complete image with a image pattern
- parameters -pointerimage handle to fill with pattern
-pointerpattern image handle
-int32x position of pattern inside the image
-int32y position of pattern inside the image
-uint32flags of color channel to fill (see ColorChannels constants)
-ImageModesimage mode to use (see ImageModes data type)
- returns -uint32error code
-blend one image inside of another image
- parameters -pointerhandle to destination image
-pointerhandle to source image
-int32x position of source image inside the destination image
-int32y position of source image inside the destination image
-ImageBlendFunccallback function to use for blending (see ImageBlendFunc data type)
-pointeruser defined arguments (will be passed to callback function)
- returns -uint32error code
-use blur filter on an image
- parameters -pointerimage handle
-floathorizontal blur radius
-floathorizontal blur strength
-floatvertical blur radius
-floatvertical blur strength
-uint32flags of color channel to blur (see ColorChannels constants)
- returns -uint32error code
-destroy an image
- parameters -pointerimage handle
- returns -uint32error code
-Post processor objects are used to manipulate glyph data before it is rendered. You are able to add shadows, borders or something like that.
- -add char range to use post processor at
- parameters -pointerpost processor handle
-int32usage of the char range (see CharRangeUsage constants)
-WideCharfirst char of the range
-WideCharlast char of the range
- returns -uint32error code
-add chars to use post processor at
- parameters -pointerpost processor handle
-int32usage of the char range (see CharRangeUsage constants)
-WideStringchars to use post processor at
- returns -uint32error code
-clear all defined char ranges and chars
- parameters -pointerpost processor handle
- returns -uint32error code
-execute the post processor
- parameters -pointerpost processor handle
-pointerchar handle to execute post processor at
-pointerimage handle to execute post processor at
- returns -uint32error code
-creates a new post processor that will fill a char with a given color
- parameters -pointercontext handle
-Colorcolor to fill char with (see Color data type)
-ImageModesimage modes to use (see ImageModes data type)
-uint32flags of color channels to fill (see ColorChannels constants)
- returns -pointerpost processor handle or NULL on failure
-creates a new post processor that will fill a char with a given pattern
- parameters -pointercontext handle
-pointerimage handle to use as pattern
-booleanTRUE: image handle is destroyed with post processor; FALSE: user must destroy image handle when finished
-Positionposition to place pattern at
-ImageModesimage modes to use (see ImageModes data type)
-uint32flags of color channels to fill (see ColorChannels constants)
- returns -pointerpost processor handle or NULL on failure
-creates a new post processor that will create a border around a char
- parameters -pointercontext handle
-floatborder width
-floatborder strength
-Colorborder color (see Color data type)
-booleanTRUE: do not change the char size; FALSE: add border to char size;
- returns -pointerpost processor handle or NULL on failure
-creates a new post processor that will create a shadow under a char
- parameters -pointercontext handle
-floatshadow radius
-floatshadow strength
-Positionshadow offset (see Position data type)
-Colorshadow color (see Color data type)
- returns -pointerpost processor handle or NULL on failure
-creates a new post processor that will execute custom code
- parameters -pointercontext handle
-pointer to PostProcessorCustomDataall needed data for custom code (see PostProcessorCustomData data type)
- returns -pointerpost processor handle or NULL on failure
-destroy post processor
- parameters -pointerpost processor handle
- returns -uint32error code
-Char objects are used to store the size of a glyph. The data can be manipulated using a post processor.
- -get the char code of a char object
- parameters -pointerchar handle
-pointer to WideCharvalue to store char code in
- returns -uint32error code
-get glyph metric of a char
- parameters -pointerchar handle
-pointer to GlyphMetricvalue to store glyph metric in (see GlyphMetric data type)
- returns -uint32error code
-set glyph metric of a char
- parameters -pointerchar handle
-pointer to GlyphMetricnew glyph metric value (see GlyphMetric data type)
- returns -uint32error code
-