All Osd String Function Documentation

TAP_Osd_PutS

Topfield Documentation

int TAP_Osd_PutS(word rgn, dword x, dword y, dword maxX, const char *str, word fcolor, word bcolor, byte fntType, byte fntSize, byte bDot, byte align);

It prints the string on the screen.

  • maxX : the maximum value in X coordinate of output area. width = maxX - X + 1
  • fcolor : character color. If 0xff, it will be transparent.
  • bcolor : background color. If 0xff, it will be transparent.
  • fntType : font type. It SHOULD be 0.
  • fntSize : font size. FNT_Size_1419, FNT_Size_1622 or FNT_Size_1926
  • bDot : It decides to print '...' in case that the string is over the maxX.
  • align : align method. ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT

Additional Documentation

The 'align' affects only if the string area (maxX - x) is greater than the width of the string.

EMJB: If (maxX - x) is less than the (first) character width nothing at all is displayed - not even part of the character nor the relevant background. Thus if you set maxX = x + 12 with the medium sized font most characters will appear, but not Q, M, or m.


TAP_Osd_GetW

Topfield Documentation

int TAP_Osd_GetW(const char *str, byte fntType, byte fntSize);

It calculates the output width with the specific font.

Additional Documentation


TAP_Osd_PutString

Topfield Documentation

int TAP_Osd_PutString(word rgn, dword x, dword y, dword maxX, const char *str, word fcolor, word bcolor, byte fntType, byte fntSize, byte nextLine);

It prints the string on the screen. This function is used to display the special characters.

  • maxX : the maximum value in X coordinate of output area. width = maxX - X + 1
  • fcolor : character color. If 0xff, it will be transparent.
  • bcolor : background color. If 0xff, it will be transparent.
  • fntType : font type. It SHOULD be 0.
  • fntSize : font size. FNT_Size_1419, FNT_Size_1622 or FNT_Size_1926
  • nextLine : It decides to print the new line character('\n').

Additional Documentation

The nextLine parameter, if set to 1, should interpret newline characters in the string as a break in the line, and render the remaining text on a new line. However, if doesn't responsd to them at all. It uses the hexadecimal character 0x8A (or octal 212) as a line break. Even then, it doesn't provide enough of a "line feed", so you need to use two. Example of the kind of string you need to pass :-

sprintf (buffer, "This is one line\212This one overlaps it" );

sprintf (buffer, "This is one line\212\212This is below it" );

sprintf (buffer, "Or split it this way%c%cInto two lines", 0x8A, 0x8A);


TAP_Osd_DrawString

Topfield Documentation

int TAP_Osd_DrawString(const char *str, dword dstWidth, word color, byte *dest, dword maxWidth, byte fntType, byte fntSize);

It prints the string on the memory.

  • dstWidth : the width of the memory
  • color : character color
  • dest : the start address of memory
  • maxWidth : the maximum width to print

Additional Documentation


TAP_Osd_PutStringAf

Topfield Documentation

int TAP_Osd_PutStringAf(word rgn, dword x, dword y, dword maxX, const char *str, word fcolor, word bcolor, byte fntType, byte fntSize, byte nextLine);

It draws the string with anti-flickering color on the screen.

  • maxX : the maximum value in X coordinate of output area. width = maxX - X + 1
  • fcolor : character color. If 0xff, it will be transparent.
  • bcolor : background color. If 0xff, it will be transparent.
  • fntType : font type. It SHOULD be 0.
  • fntSize : font size. FNT_Size_1419, FNT_Size_1622 or FNT_Size_1926
  • nextLine : It decides to print the new line character('\n').
  • lut : the LUT for anti-flickering

Additional Documentation

LUT = Look-Up Table