5void FMUC_PutStringAA(word rgn, dword x, dword y, dword maxX,
const char *str, dword fcolor, dword bcolor,
tFontDataUC *FontData,
byte bDot,
byte align,
float AntiAliasFactor)
18 int width = 0, newstrlen;
19 dword LastBackgroundPixel = 0;
20 byte LastForegroundPixel = 0;
25 bool hasAnsiChars, hasUTFChars;
28 bool isDiacriticalMark;
31 if(!str || !str[0] || !FontData || (maxX <= x))
41 if(hasAnsiChars && !hasUTFChars)
43 newstr = TAP_MemAlloc((strlen(str) << 2) + 20);
54 newstrlen = strlen(str) + 20;
55 newstr = TAP_MemAlloc(newstrlen);
62 strncpy(newstr, str, newstrlen);
63 newstr[newstrlen - 1] =
'\0';
78 newstrlen = strlen(newstr);
86 width = GlyphData->
Width;
92 }
while((XEnd > (
int)maxX) && (width != 0) && (newstrlen > 0) && (p > newstr));
106 newstrlen = strlen(newstr);
113 width = GlyphData->
Width;
119 }
while((XEnd > (
int)maxX) && (width != 0) && (newstrlen > 0) && (p > newstr));
134 newstrlen = strlen(newstr);
140 width = GlyphData->
Width;
145 }
while((XEnd > (
int)maxX) && (width != 0) && (newstrlen > 0));
147 DeleteAt(newstr, 0, (
int)(p - newstr));
174 SaveBoxX = x + ((maxX - XEnd) >> 1);
180 SaveBoxX = maxX - (XEnd - x);
189 if(bcolor & 0xff000000)
191 TAP_Osd_FillBox(rgn, x, y, maxX - x + 1, YEnd - y + 1, bcolor);
195 PixelData = (dword*) TAP_Osd_SaveBox(rgn, SaveBoxX, y, XEnd - x + 1, YEnd - y + 1);
202 pEnd = p + strlen(p);
211 if(isDiacriticalMark)
215 CX = LastCC - (GlyphData->
Width >> 1);
219 CW = GlyphData->
Width;
222 for(
Y = 0;
Y < CH;
Y++)
224 CY = (XEnd - x + 1) *
Y;
226 dword *pd = &PixelData[CX + CY];
228 for(
X = 0;
X < CW;
X++)
230 Grey = *FontBitmap++;
239 if(bcolor & 0xff000000)
245 if((LastForegroundPixel != Grey) || (LastBackgroundPixel != *pd))
247 LastBackgroundPixel = *pd;
248 LastForegroundPixel = Grey;
249 LastPixel = (fcolor & 0xff000000) |
FM_AlphaBlendRGB(Grey, fcolor, LastBackgroundPixel, AntiAliasFactor);
260 if(isDiacriticalMark)
267 LastCC = CX + (CW >> 1);
274 TAP_Osd_RestoreBox(rgn, SaveBoxX, y, XEnd - x + 1, YEnd - y + 1, PixelData);
275 TAP_MemFree(PixelData);
byte * FMUC_FindNextUTF8(byte *p)
byte * FMUC_FindUTF8Start(byte *p)
void FM_InitAlphaLUT(dword fgColor, dword bgColor, float AntiAliasFactor)
tGlyphCacheUC * FMUC_GetGlyphData(tFontDataUC *FontData, const byte *UTF8Character, byte *BytesPerChar)
dword FM_AlphaBlendRGB(byte Alpha, dword FG, dword BG, float AntiAliasFactor)
bool FMUC_IsDiacriticalMark(dword Character)
dword FMUC_GetStringHeight(const char *Text, tFontDataUC *FontData)
dword FMUC_GetStringWidth(const char *Text, tFontDataUC *FontData)
void FMUC_PutStringAA(word rgn, dword x, dword y, dword maxX, const char *str, dword fcolor, dword bcolor, tFontDataUC *FontData, byte bDot, byte align, float AntiAliasFactor)
word GetOSDRegionWidth(word Region)
void GetStringEncoding(const char *Text, bool *hasAnsiChars, bool *hasUTFChars)
void MakeValidFileName(char *strName, eRemoveChars ControlCharacters)
bool StrToUTF8(const byte *SourceString, byte *DestString, byte DefaultISO8859CharSet)
void InsertAt(const char *SourceString, int Pos, char *NewString)
void DeleteAt(char *SourceString, int Pos, int Len)