OPL development Version information Functions in UniOpx

Functions in UniOpx

UOSupported&

Returns 1 if UniFEP is installed and activated on the system, 0 otherwise.

UOPrint:(win&, BYREF x&, y&, size%, str$)

Prints the string str$ on the window win& at position (x&, y&), and updates the position. The font size is selected using size%. The OPX supports 10 different sizes of Unicode text. Suitable constants KUOTiny%, KUOSmall%, KUONormal%, KUOLarge%, etc., are defined in UniOpx.oxh. Note that UniFEP V1 also allowed to use KUOHuge7% and KUOHuge8%, these are not legal in UniFEP V2.

There is not much reason to use this function for small font sizes, as gPRINT is faster and more convenient. UOPrint has one advantage, though: It can show large glyphs by enlarging fonts, something that OPL cannot do.

UOFontMetric:(size%, BYREF height&, BYREF descent&)

This function allows you to find the height of a character cell and the descent in pixels.

UOTextWidth&:(size%, str$)

Return the width of the string in pixels if displayed using the Unicode font of size%.

UOCopyFromClip&:(buf&, buflen&, lf%)

Copies rich text in UTF8, UniFEP or KEdit format from clipboard to UTF8 buffer, returning length of text. Lf% determines the style of linefeed (Unix, DOS, Mac, see UniOpx.oxh). The buffer has to be allocated using ALLOC before calling this function.

UOCopyToClip:(buf&, buflen&)

Copy UTF8 buffer to clipboard (in UTF8).

UOBufferAsString$:(buf&, len&)

This and the following function make dealing with buffers easier, as they convert between buffers and OPL strings. Be careful: OPL strings cannot contain more than 255 characters, and that is only 85 Japanese characters!

The function creates a string with the contents of the buffer.

UOBufferFromString&:(buf&, len&, str$)

Puts the string in the buffer, returning the length.

UONumEncodings%:

Returns the number of installed codecs.

UOEncodingName$:(num%)

Returns the name of a codec.

If you need a particular encoding, look for its UID, as the name can change in different locales/versions of UniFEP. The name is meant to be used when you make a dCHOICE to let the user select an encoding.

UOEncodingUid&:(num%)

Returns the of a codec.

Note that this function is not available in the earliest UniFEP versions.

Constants for the UID's are defined in the header file.

UOReleaseEncoding:(num%)

The encoding with the given index is no longer needed and will be unloaded, if it is not used by another program.

UOEncodeChar&:(uni&, enc%)

Convert a single character from Unicode to a national encoding, given by its index.

UODecodeChar&:(ch&, enc%)

Convert a single character from a national encoding (given by its index) to Unicode.

UOEncode&:(frombuf&, fromlen&, tobuf&, tolen&, enc%)

Convert a whole buffer from Unicode (in UTF8) to a national encoding system. Returns the length of the output text.

UODecode&:(frombuf&, fromlen&, tobuf&, tolen&, enc%)

Convert a whole buffer from a national encoding system to Unicode (in UTF8). Returns the length of the output text.

UOWChar&:(buf&, BYREF pos&)

Interprets the buffer contents at position pos& as the beginning of a UTF8 encoded character, and returns the Unicode codepoint of the character. The position pos& is updated to point to the next UTF8 character.

UOUtf$:(uni&)

Returns a string with the UTF8 encoding of the Unicode character uni&.

UOEnableUtf8:

Sets up UniFEP V1 to modify the EPOC graphics system so that text displayed by gPRINT as well as in the menus, dialogs, and toolbar buttons uses UTF8 encoded Unicode. You can now use ordinary OPL commands for text display, menus and dialogs, and the Toolbar.opo module for the toolbar.

This is no longer needed for UniFEP V2 and V3.


Otfried Cheong and Enfour, Inc. Version 2.59, December 31, 2000.

OPL development Version information Functions in UniOpx