mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Used non-bold vector font, improve alignment, and make curves lower quality
This commit is contained in:
parent
f129842138
commit
a42f268d40
@ -2,6 +2,7 @@
|
||||
Fix glitches in jshGetSystemTime
|
||||
Added Graphics.setFontCustom for custom fonts
|
||||
Added String.lastIndexOf, and made String.indexOf with fromIndex work
|
||||
Used non-bold vector font, improve alignment, and make curves lower quality
|
||||
|
||||
1v57 : Tweak IRQ priorities to try and make SPI RX more reliable
|
||||
Make http default to port 80 if no port is specified in options
|
||||
|
||||
@ -326,16 +326,17 @@ unsigned int graphicsFillVectorChar(JsGraphics *gfx, short x1, short y1, short s
|
||||
short verts[VECTOR_FONT_MAX_POLY_SIZE*2];
|
||||
int i, idx=0;
|
||||
for (i=0;i<vector.vertCount;i+=2) {
|
||||
verts[idx+0] = (short)(x1+((vectorFontPolys[vector.vertOffset+i+0]&0x7F)*size/48));
|
||||
verts[idx+1] = (short)(y1+((vectorFontPolys[vector.vertOffset+i+1]&0x7F)*size/48)-(size>>2));
|
||||
verts[idx+0] = (short)(x1+(((vectorFontPolys[vector.vertOffset+i+0]&0x7F)*size+(VECTOR_FONT_POLY_SIZE/2))/VECTOR_FONT_POLY_SIZE));
|
||||
verts[idx+1] = (short)(y1+(((vectorFontPolys[vector.vertOffset+i+1]&0x7F)*size+(VECTOR_FONT_POLY_SIZE/2))/VECTOR_FONT_POLY_SIZE));
|
||||
idx+=2;
|
||||
if (vectorFontPolys[vector.vertOffset+i+1] & VECTOR_FONT_POLY_SEPARATOR) {
|
||||
graphicsFillPoly(gfx,idx/2, verts);
|
||||
|
||||
if (jspIsInterrupted()) break;
|
||||
idx=0;
|
||||
}
|
||||
}
|
||||
return (vector.width * (unsigned int)size)/96;
|
||||
return (vector.width * (unsigned int)size)/(VECTOR_FONT_POLY_SIZE*2);
|
||||
}
|
||||
|
||||
// returns the width of a character
|
||||
@ -344,7 +345,7 @@ unsigned int graphicsVectorCharWidth(JsGraphics *gfx, short size, char ch) {
|
||||
if (size<0) return 0;
|
||||
if (ch<vectorFontOffset || ch-vectorFontOffset>=vectorFontCount) return 0;
|
||||
VectorFontChar vector = vectorFonts[ch-vectorFontOffset];
|
||||
return (vector.width * (unsigned int)size)/96;
|
||||
return (vector.width * (unsigned int)size)/(VECTOR_FONT_POLY_SIZE*2);
|
||||
}
|
||||
|
||||
// Splash screen
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user