@@ -44,6 +44,12 @@ void usage(const char *prog)
/* An example function drawing something. */
void drawShapes()
{
+ char *font_file = ksplot_find_font_file("FreeMono", "FreeMonoBold");
+ struct ksplot_font font;
+
+ ksplot_init_font(&font, 40, font_file);
+ free(font_file);
+
/* Clear the screen. */
glClear(GL_COLOR_BUFFER_BIT);
@@ -57,6 +63,11 @@ void drawShapes()
t._color = {100, 200, 50};
t.draw();
+ /* Print/draw "Hello Kernel!". */
+ if (!ksplot_font_is_loaded(&font))
+ ksplot_print_text(&font, t._color.color_c_ptr(), 250, 70,
+ "Hello Kernel!");
+
KsPlot::Rectangle r;
KsPlot::Point d(400, 200), e(400, 300), f(500, 300), g(500, 200);
r.setPoint(0, d);
run: kernel-shark/bin/dplot -s And if the font file is loaded successfully you will see "Hello Kernel!" rendered. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- kernel-shark/examples/dataplot.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+)