diff --git a/apps/regression/graph_controller.cpp b/apps/regression/graph_controller.cpp index 8a7895855..04be6f253 100644 --- a/apps/regression/graph_controller.cpp +++ b/apps/regression/graph_controller.cpp @@ -121,8 +121,8 @@ void GraphController::reloadBannerView() { double x = m_cursor->x(); // Display a specific legend if the mean dot is selected if (*m_selectedDotIndex == m_store->numberOfPairsOfSeries(*m_selectedSeriesIndex)) { - // \xCC\x84 represents the combining bar ' ̄' - legend = "x\xCC\x84="; + // \xCC\x85 represents the combining overline ' ̅' + legend = "x\xCC\x85="; x = m_store->meanOfColumn(*m_selectedSeriesIndex, 0); } numberOfChar += strlcpy(buffer, legend, bufferSize); @@ -139,8 +139,8 @@ void GraphController::reloadBannerView() { legend = "y="; double y = m_cursor->y(); if (*m_selectedDotIndex == m_store->numberOfPairsOfSeries(*m_selectedSeriesIndex)) { - // \xCC\x84 represents the combining bar ' ̄' - legend = "y\xCC\x84="; + // \xCC\x85 represents the combining overline ' ̅' + legend = "y\xCC\x85="; y = m_store->meanOfColumn(*m_selectedSeriesIndex, 1); } numberOfChar += strlcpy(buffer, legend, bufferSize); diff --git a/kandinsky/Makefile b/kandinsky/Makefile index 8389a12ad..fcb8533dd 100644 --- a/kandinsky/Makefile +++ b/kandinsky/Makefile @@ -47,13 +47,13 @@ RASTERIZER := $(BUILD_DIR)/kandinsky/fonts/rasterizer $(eval $(call rule_for, \ RASTER, \ kandinsky/fonts/SmallSourcePixel.cpp, \ - kandinsky/fonts/SmallSourcePixel.ttf $$(RASTERIZER), \ + kandinsky/fonts/SmallSourcePixel.otf $$(RASTERIZER), \ $$(RASTERIZER) $$< 12 12 SmallFont $$@ \ )) $(eval $(call rule_for, \ RASTER, \ kandinsky/fonts/LargeSourcePixel.cpp, \ - kandinsky/fonts/LargeSourcePixel.ttf $$(RASTERIZER), \ + kandinsky/fonts/LargeSourcePixel.otf $$(RASTERIZER), \ $$(RASTERIZER) $$< 16 16 LargeFont $$@ \ )) diff --git a/kandinsky/fonts/LargeSourcePixel.otf b/kandinsky/fonts/LargeSourcePixel.otf new file mode 100644 index 000000000..af4a23373 Binary files /dev/null and b/kandinsky/fonts/LargeSourcePixel.otf differ diff --git a/kandinsky/fonts/LargeSourcePixel.ttf b/kandinsky/fonts/LargeSourcePixel.ttf deleted file mode 100644 index 6271613a0..000000000 Binary files a/kandinsky/fonts/LargeSourcePixel.ttf and /dev/null differ diff --git a/kandinsky/fonts/SmallSourcePixel.otf b/kandinsky/fonts/SmallSourcePixel.otf new file mode 100644 index 000000000..02feffc75 Binary files /dev/null and b/kandinsky/fonts/SmallSourcePixel.otf differ diff --git a/kandinsky/fonts/SmallSourcePixel.ttf b/kandinsky/fonts/SmallSourcePixel.ttf deleted file mode 100644 index 24a6760a8..000000000 Binary files a/kandinsky/fonts/SmallSourcePixel.ttf and /dev/null differ diff --git a/kandinsky/fonts/code_points.h b/kandinsky/fonts/code_points.h index 01c5bb6cb..aa5d997df 100644 --- a/kandinsky/fonts/code_points.h +++ b/kandinsky/fonts/code_points.h @@ -122,7 +122,7 @@ uint32_t CodePoints[] = { 0x301, // ́ // COMBINING ACUTE ACCENT 0x302, // ̂ // COMBINING CIRCUMFLEX ACCENT 0x303, // ̃ // COMBINING TILDE - 0x304, // ̄ // COMBINING MACRON + 0x305, // ̅ // COMBINING OVERLINE 0x308, // ̈ // COMBINING DIAERESIS 0x30a, // ̊ // COMBINING RING ABOVE 0x327, // ̧ // COMBINING CEDILLA @@ -142,6 +142,7 @@ uint32_t CodePoints[] = { 0x2248, // ≈ // ALMOST EQUAL TO 0x2264, // ≤ // LESS-THAN OR EQUAL TO 0x2265, // ≥ // GREATER-THAN OR EQUAL TO + 0xFFFD, // � // REPLACEMENT CHARACTER 0x1d422, // 𝐢 // MATHEMATICAL BOLD SMALL I" }; diff --git a/kandinsky/include/kandinsky/font.h b/kandinsky/include/kandinsky/font.h index 0d47e9d4a..06d3dfe6d 100644 --- a/kandinsky/include/kandinsky/font.h +++ b/kandinsky/include/kandinsky/font.h @@ -21,7 +21,7 @@ * kandinsky/fonts/code_points.h). To easily compute the index of a code point in * the CodePoints table, we use the m_table matching table: it contains the * CodePointIndexPairs of the first code point of each series of consecutive - * code points in the CodePoints table. */ + * code points in the CodePoints table. This table is create in rasterizer.c. */ class KDFont { private: diff --git a/kandinsky/src/font.cpp b/kandinsky/src/font.cpp index 4915337c5..b13ace8ac 100644 --- a/kandinsky/src/font.cpp +++ b/kandinsky/src/font.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -80,6 +81,8 @@ void KDFont::colorizeGlyphBuffer(const RenderPalette * renderPalette, GlyphBuffe } KDFont::GlyphIndex KDFont::indexForCodePoint(CodePoint c) const { + int defaultIndex = NumberOfCodePoints - 2; + assert(CodePoints[defaultIndex] == 0xFFFD); #define USE_BINARY_SEARCH 0 #if USE_BINARY_SEARCH int lowerBound = 0; @@ -133,7 +136,7 @@ KDFont::GlyphIndex KDFont::indexForCodePoint(CodePoint c) const { #else const CodePointIndexPair * currentPair = m_table; if (c < currentPair->codePoint()) { - return 0; + return defaultIndex; } const CodePointIndexPair * endPair = m_table + m_tableLength - 1; while (currentPair < endPair) { @@ -141,7 +144,7 @@ KDFont::GlyphIndex KDFont::indexForCodePoint(CodePoint c) const { if (c < nextPair->codePoint()) { CodePoint lastCodePointOfCurrentPair = currentPair->codePoint() + (nextPair->glyphIndex() - currentPair->glyphIndex() - 1); if (c > lastCodePointOfCurrentPair) { - return 0; + return defaultIndex; } return currentPair->glyphIndex() + (c - currentPair->codePoint()); } @@ -150,6 +153,6 @@ KDFont::GlyphIndex KDFont::indexForCodePoint(CodePoint c) const { if (endPair->codePoint() == c) { return endPair->glyphIndex(); } - return 0; + return defaultIndex; #endif }