if (i != colorcache.end())
return i->second;
gLookup &n=colorcache.insert(std::pair<fntColorCacheKey,gLookup>(key,gLookup())).first->second;
- eDebug("[FONT] creating new font color cache entry %02x%02x%02x%02x .. %02x%02x%02x%02x", start.a, start.r, start.g, start.b,
- end.a, end.r, end.g, end.b);
+// eDebug("[FONT] creating new font color cache entry %02x%02x%02x%02x .. %02x%02x%02x%02x", start.a, start.r, start.g, start.b,
+// end.a, end.r, end.g, end.b);
n.build(16, pal, start, end);
-/* for (int i=0; i<16; i++)
- eDebugNoNewLine("%02x|%02x%02x%02x%02x ", (int)n.lookup[i], pal.data[n.lookup[i]].a, pal.data[n.lookup[i]].r, pal.data[n.lookup[i]].g, pal.data[n.lookup[i]].b);
- eDebug("");*/
+// for (int i=0; i<16; i++)
+// eDebugNoNewLine("%02x|%02x%02x%02x%02x ", (int)n.lookup[i], pal.data[n.lookup[i]].a, pal.data[n.lookup[i]].r, pal.data[n.lookup[i]].g, pal.data[n.lookup[i]].b);
+// eDebug("");
return n;
}
return 0;
}
-FTC_FaceID fontRenderClass::getFaceID(const eString &face)
+FTC_FaceID fontRenderClass::getFaceID(const std::string &face)
{
for (fontListEntry *f=font; f; f=f->next)
{
return res;
}
-eString fontRenderClass::AddFont(const eString &filename, const eString &name, int scale)
+std::string fontRenderClass::AddFont(const std::string &filename, const std::string &name, int scale)
{
eDebugNoNewLine("[FONT] adding font %s...", filename.c_str());
fflush(stdout);
// FT_Done_FreeType(library);
}
-int fontRenderClass::getFont(ePtr<Font> &font, const eString &face, int size, int tabwidth)
+int fontRenderClass::getFont(ePtr<Font> &font, const std::string &face, int size, int tabwidth)
{
FTC_FaceID id=getFaceID(face);
if (!id)
setFont(fnt, replacement);
}
-eString eTextPara::replacement_facename;
+std::string eTextPara::replacement_facename;
void eTextPara::setFont(Font *fnt, Font *replacement)
{
void
shape (std::vector<unsigned long> &string, const std::vector<unsigned long> &text);
-int eTextPara::renderString(const eString &string, int rflags)
+int eTextPara::renderString(const std::string &string, int rflags)
{
singleLock s(ftlock);
std::vector<unsigned long> uc_string, uc_visual;
uc_string.reserve(string.length());
- eString::const_iterator p(string.begin());
+ std::string::const_iterator p(string.begin());
while(p != string.end())
{
- unsigned int unicode=*p++;
+ unsigned int unicode=(unsigned char)*p++;
if (unicode & 0x80) // we have (hopefully) UTF8 here, and we assume that the encoding is VALID
{
continue;
int rx=i->x+glyph_bitmap->left + offset.x();
int ry=i->y-glyph_bitmap->top + offset.y();
+
__u8 *d=(__u8*)(surface->data)+buffer_stride*ry+rx*surface->bypp;
__u8 *s=glyph_bitmap->buffer;
register int sx=glyph_bitmap->width;
{
register __u8 *td=d;
register int ax;
+
for (ax=0; ax<sx; ax++)
{
register int b=(*s++)>>4;