New font and italic in python keywords (#232)

This commit is contained in:
Oreig403
2022-07-01 11:39:23 +02:00
committed by GitHub
parent 2a234305f3
commit 99b070a30d
15 changed files with 183 additions and 35 deletions

View File

@@ -66,14 +66,18 @@ ifdef HAS_READER
kandinsky_src += $(addprefix kandinsky/fonts/, \
LargeFontExtended.ttf \
ItalicLargeFontExtended.ttf \
SmallFontExtended.ttf \
ItalicSmallFontExtended.ttf \
LargeFontSimple.ttf \
SmallFontSimple.ttf \
)
default_kandinsky_src += $(addprefix kandinsky/fonts/, \
LargeFontExtended.ttf \
ItalicLargeFontExtended.ttf \
SmallFontExtended.ttf \
ItalicSmallFontExtended.ttf \
)
simple_kandinsky_src += $(addprefix kandinsky/fonts/, \
@@ -81,23 +85,28 @@ simple_kandinsky_src += $(addprefix kandinsky/fonts/, \
SmallFontSimple.ttf \
)
$(eval $(call raster_font,SmallFont,SmallFontExtended,1,12,7,14))
$(eval $(call raster_font,ItalicSmallFont,ItalicSmallFontExtended,1,12,7,14))
$(eval $(call raster_font,LargeFont,LargeFontExtended,1,16,10,18))
$(eval $(call raster_font,ItalicLargeFont,ItalicLargeFontExtended,1,16,10,18))
$(eval $(call raster_font,SmallFont,SmallFontSimple,0,12,7,14))
$(eval $(call raster_font,LargeFont,LargeFontSimple,0,16,10,18))
else
kandinsky_src += $(addprefix kandinsky/fonts/, \
LargeFont.ttf \
ItalicLargeFont.ttf \
SmallFont.ttf \
ItalicSmallFont.ttf \
)
default_kandinsky_src = $(kandinsky_src)
simple_kandinsky_src = $(kandinsky_src)
$(eval $(call raster_font,SmallFont,SmallFontSimple,0,12,7,14))
$(eval $(call raster_font,ItalicSmallFont,ItalicSmallFontSimple,0,12,7,14))
$(eval $(call raster_font,LargeFont,LargeFontSimple,0,16,10,18))
$(eval $(call raster_font,ItalicLargeFont,ItalicLargeFontSimple,0,16,10,18))
endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -326,7 +326,7 @@ uint32_t ExtendedCodePoints[] = {
0x3c7, // χ // GREEK SMALL LETTER KHI
0x3c8, // ψ // GREEK SMALL LETTER PSI
0x3c9, // ω // GREEK SMALL LETTER OMEGA
0x454, // є // CYRILLIC SMALL LETTER UKRAINIAN LE
0x454, // є // CYRILLIC SMALL LETTER UKRAINIAN LE - SMALL IN (in)
0x1d07, // ᴇ // LATIN LETTER SMALL CAPITAL E
0x2026, // … // HORIZONTAL ELLIPSIS
0x212f, // // SCRIPT SMALL E
@@ -346,16 +346,25 @@ uint32_t ExtendedCodePoints[] = {
0x21d3, // ⇓ // DOUBLE BOTTOM ARROW (Downarrow)
0x2200, // ∀ // FORALL
0x2202, // ∂ // PARTIAL
0x2203, // ∃ // EXIST
0x2203, // ∃ // EXISTS (exists)
0x2204, // ∄ // NOT EXISTS (nexists)
0x2208, // ∈ // BIG IN (In)
0x2209, // ∉ // BIG NOT IN (Notin)
0x2211, // ∑ // N-ARY SUMMATION
0x221a, // √ // SQUARE ROOT
0x221e, // ∞ // INFINITY
0x2229, // ∩ // SMALL INTERSECTION (cap)
0x222a, // // SMALL UNION (cup)
0x222b, // ∫ // INTEGRAL
0x2248, // ≈ // ALMOST EQUAL TO
0x2260, // ≠ // NOT EQUAL TO
0x2261, // ≡ // IS CONGRUENT TO
0x2264, // ≤ // LESS-THAN OR EQUAL TO
0x2265, // ≥ // GREATER-THAN OR EQUAL TO
0x2282, // ⊂ // IS INCLUDED (subset)
0x2284, // ⊄ // IS NOT INCLUDED (nsubset)
0x22c2, // ⋂ // BIG INTERSECTION (Cap)
0x22c3, // // BIG UNION (Cup)
0x2505, // ┅ // BOX DRAWING EQU HEAVY DASH HORIZONTAL
0x27e6, // ⟦ // MATHEMATICAL LEFT INT BRACKET SET
0x27e7, // ⟧ // MATHEMATICAL RIGHT INT BRACKET SET

View File

@@ -123,12 +123,15 @@ int main(int argc, char * argv[]) {
}
int glyph_width = maxWidth-1;
if (glyph_width == 9) { glyph_width = 10; } /* This was made to avoid a problem, the ratio of the width by the height was not */
if (glyph_width == 8) { glyph_width = 7; } /* adequate and the fonts couldn't be compiled, this is useless with other fonts */
if (packed_glyph_width != 0) {
ENSURE(glyph_width == packed_glyph_width, "Expecting a packed glyph width of %d but got %d instead", packed_glyph_width, glyph_width);
} else {
printf("Computed packed_glyph_width = %d\n", glyph_width);
}
int glyph_height = maxAboveBaseline+maxBelowBaseline;
if (glyph_height == 13) { glyph_height = 14;} /* Same problem */
if (packed_glyph_height != 0) {
ENSURE(glyph_height == packed_glyph_height, "Expecting a packed glyph height of %d but got %d instead", packed_glyph_height, glyph_height);
} else {

View File

@@ -28,10 +28,14 @@ private:
static constexpr int k_bitsPerPixel = 4; // TODO: Should be generated by the rasterizer
static constexpr int k_maxGlyphPixelCount = 180; //TODO: Should be generated by the rasterizer
static const KDFont privateLargeFont;
static const KDFont privateItalicLargeFont;
static const KDFont privateSmallFont;
static const KDFont privateItalicSmallFont;
public:
static constexpr const KDFont * LargeFont = &privateLargeFont;
static constexpr const KDFont * ItalicLargeFont = &privateItalicLargeFont;
static constexpr const KDFont * SmallFont = &privateSmallFont;
static constexpr const KDFont * ItalicSmallFont = &privateItalicSmallFont;
static bool CanBeWrittenWithGlyphs(const char * text);
@@ -61,7 +65,7 @@ public:
CodePoint m_codePoint;
GlyphIndex m_glyphIndex;
};
static constexpr GlyphIndex IndexForReplacementCharacterCodePoint = 200;
static constexpr GlyphIndex IndexForReplacementCharacterCodePoint = 209;
GlyphIndex indexForCodePoint(CodePoint c) const;
void setGlyphGrayscalesForCodePoint(CodePoint codePoint, GlyphBuffer * glyphBuffer) const;