}
//FT_Set_Char_Size(fontEntry.face, (int)(font.size * 64), (int)(font.size * 64), 96, 96);
fontEntry.scale = FaceSetCharSize(fontEntry.face, font.size);
+ if(!font.scale)
+ font.scale = fontEntry.scale;
if(!c)
{
if(!fontEntry.face->units_per_EM)
}
#endif
}
+ public property int ascent
+ {
+ get { return (int)(this ? ascent * scale : 0); }
+ }
};
public class LFBDisplay : struct
}
#endif
+#if !defined(ECERE_NOTRUETYPE)
static int utf16BufferSize = 0;
static uint16 * utf16 = null;
+#endif
public class LFBDisplayDriver : DisplayDriver
{
LFBDisplay lfbDisplay = display ? display.driverData : null;
LFBSurface lfbSurface = surface.driverData;
uint index;
- if(display) color = color /*& 0xFFFFFF*/;
+ //if(display) color = color & 0xFFFFFF;
lfbSurface.foregroundRgb = color;
if(lfbSurface.font && lfbDisplay)
{
LFBDisplay lfbDisplay = display ? display.driverData : null;
LFBSurface lfbSurface = surface.driverData;
- color = color /*& 0xFFFFFF*/;
+ //color = color & 0xFFFFFF;
switch(lfbSurface.bitmap.pixelFormat)
{
case pixelFormat8:
int c;
for(c = 0; c < w; c++, dest++)
{
- Color destColor;
+ Color destColor = 0;
if(pixelFormat == pixelFormat565) { destColor = (Color)*(Color565 *)dest; }
else if(pixelFormat == pixelFormat555) { destColor = (Color)*(Color555 *)dest; }
else if(pixelFormat == pixelFormat444) { destColor = (Color)*(Color444 *)dest; }
ColorAlpha * backsrc;
ColorAlpha * source = ((ColorAlpha *) src.picture) + sy * addsource + sx;
ColorAlpha * dest = ((ColorAlpha *) lfbSurface.bitmap.picture) + dy * adddest + dx;
- if(flip < 0) source += sw-1;
+ if(flip) source += sw-1;
adddest -= w;
yerr = 0;
for(y=0; y<sh; y++)
// printf("Locating %s\n", faceName);
if(matched)
{
- FcPatternGetString(matched, FC_FAMILY, 0, &family);
+ FcPatternGetString(matched, FC_FAMILY, 0, (FcChar8 **)&family);
//printf("Fontconfig returned %s\n", family);
}
if(matched && (result == FcResultMatch /*|| result == FcResultNoId*/) /*&& !strcmpi(family, faceName)*/)
{
double fontSize;
- FcPatternGetString (matched, FC_FILE, 0, &fileName2);
+ FcPatternGetString (matched, FC_FILE, 0, (FcChar8 **)&fileName2);
FcPatternGetInteger(matched, FC_INDEX, 0, &fontID);
FcPatternGetDouble(matched, FC_SIZE, 0, &fontSize);
strcpy(fileName, fileName2);
matched = FcFontMatch (0, pattern, &result);
if(matched)
{
- FcPatternGetString(matched, FC_FAMILY, 0, &family);
+ FcPatternGetString(matched, FC_FAMILY, 0, (FcChar8 **)&family);
// printf("Fontconfig returned %s\n", family);
}
if(matched && (result == FcResultMatch /*|| result == FcResultNoId*/) &&
- FcPatternGetString(matched, FC_FAMILY, 0, &family) == FcResultMatch /*&& !strcmpi(family, links + linksPos + c + 1)*/)
+ FcPatternGetString(matched, FC_FAMILY, 0, (FcChar8 **)&family) == FcResultMatch /*&& !strcmpi(family, links + linksPos + c + 1)*/)
{
double fontSize;
- FcPatternGetString (matched, FC_FILE, 0, &fileName2);
+ FcPatternGetString (matched, FC_FILE, 0, (FcChar8 **)&fileName2);
FcPatternGetInteger(matched, FC_INDEX, 0, &fontID);
FcPatternGetDouble(matched, FC_SIZE, 0, &fontSize);
strcpy(fileName, fileName2);
int c, nb, glyphIndex = 0;
unichar lastPack = 0;
GlyphPack pack = font.asciiPack;
- int wc;
- uint * glyphs;
+ int wc = 0;
+ uint * glyphs = null;
int numGlyphs = 0;
bool rightToLeft = false;
int fontEntryNum = 0;
for(c = 0; c < len || (numGlyphs && (rightToLeft ? (glyphIndex >= 0) : (glyphIndex < numGlyphs)));)
{
- uint glyphNo;
+ uint glyphNo = 0;
uint packNo;
if(numGlyphs && (rightToLeft ? (glyphIndex >= 0) : (glyphIndex < numGlyphs)))
{
char * family;
FontEntry fontEntry;
char * fileName = null;
- bool fakeItalic = false;
for(fontEntryNum = 0; fontEntryNum<MAX_FONT_LINK_ENTRIES; fontEntryNum++)
if(!font.fontEntries[fontEntryNum])
break;
matched = FcFontMatch (0, pattern, &result);
if(matched)
{
- FcPatternGetString(matched, FC_FAMILY, 0, &family);
+ FcPatternGetString(matched, FC_FAMILY, 0, (FcChar8 **)&family);
//printf("Fontconfig returned %s\n", family);
}
- if(matched && (result == FcResultMatch) && FcPatternGetString(matched, FC_FAMILY, 0, &family) == FcResultMatch)
+ if(matched && (result == FcResultMatch) && FcPatternGetString(matched, FC_FAMILY, 0, (FcChar8 **)&family) == FcResultMatch)
{
- FcPatternGetString (matched, FC_FILE, 0, &fileName);
+ FcPatternGetString (matched, FC_FILE, 0, (FcChar8 **)&fileName);
FcPatternGetInteger(matched, FC_INDEX, 0, &fontID);
FcPatternGetDouble(matched, FC_SIZE, 0, &fontSize);
// printf("\nMatched to %s, %f\n", fileName, fontSize);
delete mesh.texCoords;
}
- bool AllocateMesh(DisplaySystem displaySystem, Mesh mesh)
+ bool AllocateMesh(DisplaySystem displaySystem, Mesh mesh, MeshFeatures flags, int nVertices)
{
bool result = false;
-
- if((!mesh.flags.vertices || mesh.vertices || (mesh.vertices = new Vector3Df[mesh.nVertices])) &&
- (!mesh.flags.normals || mesh.normals || (mesh.normals = new Vector3Df[mesh.nVertices])) &&
- (!mesh.flags.texCoords1 || mesh.texCoords || (mesh.texCoords = new Pointf [mesh.nVertices])))
+ if(mesh.nVertices == nVertices)
+ {
result = true;
+ // Same number of vertices, adding features (Leaves the other features pointers alone)
+ if(mesh.flags != flags)
+ {
+ if(!mesh.flags.vertices && flags.vertices)
+ {
+ if(flags.doubleVertices)
+ {
+ mesh.vertices = (Vector3Df *)new Vector3D[nVertices];
+ }
+ else
+ mesh.vertices = new Vector3Df[nVertices];
+ }
+ if(!mesh.flags.normals && flags.normals)
+ {
+ if(flags.doubleNormals)
+ {
+ mesh.normals = (Vector3Df *)new Vector3D[nVertices];
+ }
+ else
+ mesh.normals = new Vector3Df[nVertices];
+ }
+ if(!mesh.flags.texCoords1 && flags.texCoords1)
+ mesh.texCoords = new Pointf[nVertices];
+ if(!mesh.flags.colors && flags.colors)
+ mesh.colors = new ColorRGBAf[nVertices];
+ }
+ }
+ else
+ {
+ result = true;
+ // New number of vertices, reallocate all current and new features
+ flags |= mesh.flags;
+ if(flags.vertices)
+ {
+ if(flags.doubleVertices)
+ {
+ mesh.vertices = (Vector3Df *)renew mesh.vertices Vector3D[nVertices];
+ }
+ else
+ mesh.vertices = renew mesh.vertices Vector3Df[nVertices];
+ }
+ if(flags.normals)
+ {
+ if(flags.doubleNormals)
+ {
+ mesh.normals = (Vector3Df *)renew mesh.normals Vector3D[nVertices];
+ }
+ else
+ mesh.normals = renew mesh.normals Vector3Df[nVertices];
+ }
+ if(flags.texCoords1)
+ mesh.texCoords = renew mesh.texCoords Pointf[nVertices];
+ if(flags.colors)
+ mesh.colors = renew mesh.colors ColorRGBAf[nVertices];
+ }
return result;
}