Files
MiniGUI/doc/man3/miniguiTextParse.3
T
2017-05-29 12:20:05 +08:00

76 lines
4.0 KiB
Plaintext

.\" This manpage is Copyright (C) 2000 Wei Yongming
.\" 2000 BluePoint Software
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since MiniGUI is constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.TH "TextParse" "3" "August 2000" "MiniGUI"
.SH "NAME"
TextParse \- Text parse in MiniGUI.
.SH "SYNOPSIS"
.B #include <minigui/gdi.h>
.br
.PP
.BI "int GUIAPI GetTextMCharInfo" "(HLOGFONT log_font, const char* mstr, int len, int* pos_chars);"
.br
.BI "int GUIAPI GetTextWordInfo" "(HLOGFONT log_font, const char* mstr, int len, int* pos_words, WORDINFO* info_words);"
.br
.BI "int GUIAPI GetFirstMCharLen" "(HLOGFONT log_font, const char* mstr, int len);"
.br
.BI "int GUIAPI GetFirstWord" "(HLOGFONT log_font, const char* mstr, int len, WORDINFO* word_info);"
.br
.BI "int GUIAPI GetTextExtentPoint" "(HDC hdc, const char* text, int len, int max_extent, int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);"
.SH "DESCRIPTION"
.PP
\fBGetTextMCharInfo\fP function retrives information of multi-byte characters in the string \fB(mstr)\fP with length of \fBlen\fP. This function returns the positions of characters in the string in an integer array pointed to by \fBpos_chars\fP.
.PP
\fBGetTextWordInfo\fP function retrives information of multi-byte words in the string \fB(mstr)\fP with length of \fBlen\fP. This function returns the positions of words in the string in an integer array pointed to by \fBpos_words\fP when the pointer is not equal to NULL. This function also returns the information of words in an WORDINFO struct array pointed to by \fBinfo_words\fP when the pointer is not NULL. WORDINFO struct in MiniGUI are defined as follows:
.nf
typedef struct _WORDINFO
{
int len; // length of the word
unsigned char delimiter; // delimiter after the word
int nr_delimiters; // number of delimiter after the word
} WORDINFO;
.fi
.PP
\fBGetFirstMCharLen\fP function retrives and returns the length of the first multi-byte character in string \fB(mstr)\fP with lenght of \fBlen\fP.
.PP
\fBGetFirstWord\fP function retrives the information of the first multi-byte character in string \fB(mstr)\fP with length of \fBlen\fP. This function returns the full length of the word including the delimiters after the word.
.PP
\fBGetTextExtentPoint\fP function computes the width and height of the specified string of text \fB(text)\fP with length of \fBlen\fP when output the text in limited space (\fBmax_extent\fP wide). If \fBpos_chars\fP and \fBdx_chars\fP are not NULL, this function will return the postions of each character in the text, and the output position of each character. This function returns the text extent in a SIZE struct pointed to by \fBsize\fP, and width of text as return value.
.SH "NOTE"
.PP
In MiniGUI, you can create logical font and specify its charset. MiniGUI handles multi-byte characters compling with the charset of the current logical font.
.SH "SEE ALSO"
.BR CreateLogFont (3),
.BR SelectFont (3)
.SH "AUTHOR"
.PP
This manual page was edited by WEI Yongming <ymwei@minigui.org>.
If you have any problems, comments or found some bugs, please send messages to me.