[chronojump] All Chronojump graphs (except R) with user selected font



commit 6b24cc0600afa808856de367b1be655096175e35
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Oct 2 14:53:37 2020 +0200

    All Chronojump graphs (except R) with user selected font

 src/gui/app1/encoder.cs               |  2 +-
 src/gui/app1/forceSensor.cs           |  2 +-
 src/gui/app1/forceSensorAnalyze.cs    |  4 ++--
 src/gui/app1/jumpsDjOptimalFall.cs    |  2 +-
 src/gui/app1/jumpsEvolution.cs        |  2 +-
 src/gui/app1/jumpsProfile.cs          |  2 +-
 src/gui/app1/jumpsRjFatigue.cs        |  4 ++--
 src/gui/app1/jumpsWeightFVProfile.cs  |  8 ++++----
 src/gui/cairo/jumpsDjOptimalFall.cs   |  6 +++---
 src/gui/cairo/jumpsEvolution.cs       |  6 +++---
 src/gui/cairo/jumpsProfile.cs         |  9 +++++----
 src/gui/cairo/jumpsRjFatigue.cs       |  6 +++---
 src/gui/cairo/jumpsWeightFVProfile.cs |  6 +++---
 src/gui/cairo/xy.cs                   | 11 +++++++----
 src/gui/encoderGraphObjects.cs        | 22 +++++++++++-----------
 src/gui/eventExecute.cs               | 16 ++++++++--------
 src/gui/sendLog.cs                    |  2 +-
 src/preferences.cs                    |  4 ++++
 18 files changed, 61 insertions(+), 53 deletions(-)
---
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 3c2be0a0..294b17cd 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -5901,7 +5901,7 @@ public partial class ChronoJumpWindow
                        UtilGtk.ErasePaint(encoder_capture_signal_drawingarea, encoder_capture_signal_pixmap);
 
                layout_encoder_capture_signal = new Pango.Layout 
(encoder_capture_signal_drawingarea.PangoContext);
-               layout_encoder_capture_signal.FontDescription = Pango.FontDescription.FromString ("Courier 
10");
+               layout_encoder_capture_signal.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(10));
 
                pen_black_encoder_signal = new Gdk.GC(encoder_capture_signal_drawingarea.GdkWindow);
                pen_blue_encoder_signal = new Gdk.GC(encoder_capture_signal_drawingarea.GdkWindow);
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 96943e0b..7e9db39b 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -200,7 +200,7 @@ public partial class ChronoJumpWindow
                pen_gray_force_capture.SetLineAttributes (1, Gdk.LineStyle.Solid, Gdk.CapStyle.NotLast, 
Gdk.JoinStyle.Miter);
 
                layout_force_text = new Pango.Layout (force_capture_drawingarea.PangoContext);
-               layout_force_text.FontDescription = Pango.FontDescription.FromString ("Courier 10");
+               layout_force_text.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(10));
        }
 
 
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 26468c56..ba1f6359 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -791,9 +791,9 @@ public partial class ChronoJumpWindow
                pen_green_discont_force_ai.SetLineAttributes (1, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.Butt, 
Gdk.JoinStyle.Round);
 
                layout_force_ai_text = new Pango.Layout (force_sensor_ai_drawingarea.PangoContext);
-               layout_force_ai_text.FontDescription = Pango.FontDescription.FromString ("Courier 10");
+               layout_force_ai_text.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(10));
                layout_force_ai_text_big = new Pango.Layout (force_sensor_ai_drawingarea.PangoContext);
-               layout_force_ai_text_big.FontDescription = Pango.FontDescription.FromString ("Courier 12");
+               layout_force_ai_text_big.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(12));
        }
 
        private void forcePaintAnalyzeGeneralTimeValue(int time, bool solid)
diff --git a/src/gui/app1/jumpsDjOptimalFall.cs b/src/gui/app1/jumpsDjOptimalFall.cs
index f1aa3765..f400ed43 100644
--- a/src/gui/app1/jumpsDjOptimalFall.cs
+++ b/src/gui/app1/jumpsDjOptimalFall.cs
@@ -83,7 +83,7 @@ public partial class ChronoJumpWindow
                if(jumpsDjOptimalFall.Point_l.Count == 0)
                {
                        //constructor for showing blank screen with a message
-                       new JumpsDjOptimalFallGraph(drawingarea_jumps_dj_optimal_fall, jumpType);
+                       new JumpsDjOptimalFallGraph(drawingarea_jumps_dj_optimal_fall, jumpType, 
preferences.fontType.ToString());
                                        //currentPerson.Name, jumpType, currentSession.DateShort);
 
                        button_jumps_dj_optimal_fall_save_image.Sensitive = false;
diff --git a/src/gui/app1/jumpsEvolution.cs b/src/gui/app1/jumpsEvolution.cs
index aa0a1196..d1efd2b4 100644
--- a/src/gui/app1/jumpsEvolution.cs
+++ b/src/gui/app1/jumpsEvolution.cs
@@ -92,7 +92,7 @@ public partial class ChronoJumpWindow
                if(jumpsEvolution.Point_l.Count == 0)
                {
                        //constructor for showing blank screen with a message
-                       new JumpsEvolutionGraph(drawingarea_jumps_evolution, jumpType);
+                       new JumpsEvolutionGraph(drawingarea_jumps_evolution, jumpType, 
preferences.fontType.ToString());
                                        //currentPerson.Name, jumpType, currentSession.DateShort);
 
                        button_jumps_evolution_save_image.Sensitive = false;
diff --git a/src/gui/app1/jumpsProfile.cs b/src/gui/app1/jumpsProfile.cs
index 861f86f9..2c1662d7 100644
--- a/src/gui/app1/jumpsProfile.cs
+++ b/src/gui/app1/jumpsProfile.cs
@@ -83,7 +83,7 @@ public partial class ChronoJumpWindow
                }
 
                JumpsProfileGraph.Do(jumpsProfile.GetIndexes(), drawingarea_jumps_profile,
-                               currentPerson.Name, currentSession.DateShort);
+                               currentPerson.Name, currentSession.DateShort, 
preferences.fontType.ToString());
        }
        private void on_drawingarea_jumps_profile_expose_event (object o, ExposeEventArgs args) 
        {
diff --git a/src/gui/app1/jumpsRjFatigue.cs b/src/gui/app1/jumpsRjFatigue.cs
index a63733bd..7e8c8a8f 100644
--- a/src/gui/app1/jumpsRjFatigue.cs
+++ b/src/gui/app1/jumpsRjFatigue.cs
@@ -146,7 +146,7 @@ public partial class ChronoJumpWindow
                                comboSelectJumpsRjFatigueNum.GetSelectedId() < 0)
                {
                        if(drawingarea_jumps_rj_fatigue != null && drawingarea_jumps_rj_fatigue.GdkWindow != 
null)
-                               new JumpsRjFatigueGraph(drawingarea_jumps_rj_fatigue, "");
+                               new JumpsRjFatigueGraph(drawingarea_jumps_rj_fatigue, "", 
preferences.fontType.ToString());
 
                        button_jumps_rj_fatigue_save_image.Sensitive = false;
                        return;
@@ -166,7 +166,7 @@ public partial class ChronoJumpWindow
                if(jumpsRjFatigue.Point_l.Count == 0)
                {
                        //constructor for showing blank screen with a message
-                       new JumpsRjFatigueGraph(drawingarea_jumps_rj_fatigue, jumpType);
+                       new JumpsRjFatigueGraph(drawingarea_jumps_rj_fatigue, jumpType, 
preferences.fontType.ToString());
 
                        button_jumps_rj_fatigue_save_image.Sensitive = false;
 
diff --git a/src/gui/app1/jumpsWeightFVProfile.cs b/src/gui/app1/jumpsWeightFVProfile.cs
index 6fbd5ec4..d04b55c3 100644
--- a/src/gui/app1/jumpsWeightFVProfile.cs
+++ b/src/gui/app1/jumpsWeightFVProfile.cs
@@ -80,7 +80,7 @@ public partial class ChronoJumpWindow
                                currentPersonSession.TrochanterFloorOnFlexion == 
Constants.TrochanterFloorOnFlexionUndefinedID)
                {
                        //constructor for showing blank screen with a message
-                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDLEGPARAMS);
+                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDLEGPARAMS, preferences.fontType.ToString());
                                        //currentPerson.Name, jumpType, currentSession.DateShort);
 
                        return;
@@ -88,7 +88,7 @@ public partial class ChronoJumpWindow
                else if(currentPersonSession.TrochanterToe <= currentPersonSession.TrochanterFloorOnFlexion)
                {
                        //constructor for showing blank screen with a message
-                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.BADLEGPARAMS);
+                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.BADLEGPARAMS, preferences.fontType.ToString());
                                        //currentPerson.Name, jumpType, currentSession.DateShort);
 
                        return;
@@ -111,10 +111,10 @@ public partial class ChronoJumpWindow
 
                if(jumpsWeightFVProfile.Point_l.Count == 0) {
                        //constructor for showing blank screen with a message
-                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDJUMPS);
+                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDJUMPS, preferences.fontType.ToString());
                } else if(jumpsWeightFVProfile.NeedMoreXData) {
                        //constructor for showing blank screen with a message
-                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDJUMPSX);
+                       new JumpsWeightFVProfileGraph(drawingarea_jumps_weight_fv_profile, 
JumpsWeightFVProfileGraph.ErrorAtStart.NEEDJUMPSX, preferences.fontType.ToString());
                } else {
                        //create the graph showing the points but showing also the error (if any)
                        JumpsWeightFVProfileGraph.ErrorAtStart errorAtStart = 
JumpsWeightFVProfileGraph.ErrorAtStart.ALLOK;
diff --git a/src/gui/cairo/jumpsDjOptimalFall.cs b/src/gui/cairo/jumpsDjOptimalFall.cs
index 30cd8c73..bd3fe11a 100644
--- a/src/gui/cairo/jumpsDjOptimalFall.cs
+++ b/src/gui/cairo/jumpsDjOptimalFall.cs
@@ -29,11 +29,11 @@ using Cairo;
 public class JumpsDjOptimalFallGraph : CairoXY
 {
        //constructor when there are no points
-       public JumpsDjOptimalFallGraph (DrawingArea area, string jumpType)//, string title, string jumpType, 
string date)
+       public JumpsDjOptimalFallGraph (DrawingArea area, string jumpType, string font)//, string title, 
string jumpType, string date)
        {
                this.area = area;
 
-               initGraph();
+               initGraph(font);
 
                g.SetFontSize(16);
                printText(area.Allocation.Width /2, area.Allocation.Height /2, 24, textHeight,
@@ -75,7 +75,7 @@ public class JumpsDjOptimalFallGraph : CairoXY
        public override void Do()
        {
                LogB.Information("at JumpsDjOptimalFallGraph.Do");
-               initGraph();
+               initGraph(font);
 
                 findPointMaximums(false);
                 findAbsoluteMaximums();
diff --git a/src/gui/cairo/jumpsEvolution.cs b/src/gui/cairo/jumpsEvolution.cs
index c38735a3..6131b703 100644
--- a/src/gui/cairo/jumpsEvolution.cs
+++ b/src/gui/cairo/jumpsEvolution.cs
@@ -28,11 +28,11 @@ using Cairo;
 public class JumpsEvolutionGraph : CairoXY
 {
        //constructor when there are no points
-       public JumpsEvolutionGraph (DrawingArea area, string jumpType)//, string title, string jumpType, 
string date)
+       public JumpsEvolutionGraph (DrawingArea area, string jumpType, string font)//, string title, string 
jumpType, string date)
        {
                this.area = area;
 
-               initGraph();
+               initGraph(font);
 
                g.SetFontSize(16);
                printText(area.Allocation.Width /2, area.Allocation.Height /2, 24, textHeight,
@@ -64,7 +64,7 @@ public class JumpsEvolutionGraph : CairoXY
        public override void Do()
        {
                LogB.Information("at JumpsEvolutionGraph.Do");
-               initGraph();
+               initGraph(font);
 
                 findPointMaximums(false);
                 //findAbsoluteMaximums();
diff --git a/src/gui/cairo/jumpsProfile.cs b/src/gui/cairo/jumpsProfile.cs
index 5c1f6bcf..c20940d4 100644
--- a/src/gui/cairo/jumpsProfile.cs
+++ b/src/gui/cairo/jumpsProfile.cs
@@ -53,7 +53,8 @@ public static class JumpsProfileGraph
                }
        }
 
-       public static void Do (List<JumpsProfileIndex> l_jpi, DrawingArea area, string title, string date)
+       public static void Do (List<JumpsProfileIndex> l_jpi, DrawingArea area,
+                       string title, string date, string font)
        {
                //LogB.Information(string.Format("is area null: {0}", (area == null)));
                //LogB.Information(string.Format("is area.GdkWindow null: {0}", (area.GdkWindow == null)));
@@ -72,7 +73,7 @@ public static class JumpsProfileGraph
                                sum += jpi.Result;
 
                //4 prepare font
-               g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
+               g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
                int textHeight = 12;
                g.SetFontSize(textHeight);
 
@@ -110,7 +111,7 @@ public static class JumpsProfileGraph
                int y = 40;
                //R seq(from=50,to=(350-24),length.out=5)
                //[1] 50 119 188 257 326 #difference is 69
-               //g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
+               //g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
                foreach(JumpsProfileIndex jpi in l_jpi)
                {
                        double percent = 100 * UtilAll.DivideSafe(jpi.Result, sum);
@@ -126,7 +127,7 @@ public static class JumpsProfileGraph
                g.SetFontSize(textHeight);
                printText(200, y+20, 0, textHeight, "Chronojump profile (" + date + ")", g, true);
 
-               //g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
+               //g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
        
                //7 print errors (if any)
                g.SetSourceRGB(0.5, 0, 0);
diff --git a/src/gui/cairo/jumpsRjFatigue.cs b/src/gui/cairo/jumpsRjFatigue.cs
index f540b394..5079eb82 100644
--- a/src/gui/cairo/jumpsRjFatigue.cs
+++ b/src/gui/cairo/jumpsRjFatigue.cs
@@ -30,11 +30,11 @@ public class JumpsRjFatigueGraph : CairoXY
        private int divideIn;
 
        //constructor when there are no points
-       public JumpsRjFatigueGraph (DrawingArea area, string jumpType)//, string title, string jumpType, 
string date)
+       public JumpsRjFatigueGraph (DrawingArea area, string jumpType, string font)//, string title, string 
jumpType, string date)
        {
                this.area = area;
 
-               initGraph();
+               initGraph(font);
 
                g.SetFontSize(16);
                //printText(area.Allocation.Width /2, area.Allocation.Height /2, 24, textHeight,
@@ -72,7 +72,7 @@ public class JumpsRjFatigueGraph : CairoXY
        public override void Do()
        {
                LogB.Information("at JumpsRjFatigueGraph.Do");
-               initGraph();
+               initGraph(font);
 
                 findPointMaximums(false);
                 //findAbsoluteMaximums();
diff --git a/src/gui/cairo/jumpsWeightFVProfile.cs b/src/gui/cairo/jumpsWeightFVProfile.cs
index dca7f4a2..5169cfa4 100644
--- a/src/gui/cairo/jumpsWeightFVProfile.cs
+++ b/src/gui/cairo/jumpsWeightFVProfile.cs
@@ -38,12 +38,12 @@ public class JumpsWeightFVProfileGraph : CairoXY
        private ErrorAtStart errorMessage;
 
        //constructor when there are no points
-       public JumpsWeightFVProfileGraph (DrawingArea area, ErrorAtStart errorMessage)//, string title, 
string jumpType, string date)
+       public JumpsWeightFVProfileGraph (DrawingArea area, ErrorAtStart errorMessage, string font)//, string 
title, string jumpType, string date)
        {
                this.area = area;
                this.errorMessage = errorMessage;
 
-               initGraph();
+               initGraph(font);
 
                plotError();
 
@@ -126,7 +126,7 @@ public class JumpsWeightFVProfileGraph : CairoXY
        public override void Do()
        {
                LogB.Information("at JumpsWeightFVProfileGraph.Do");
-               initGraph();
+               initGraph(font);
 
                if(showFullGraph)
                        findPointMaximums(true);
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index 580d9487..111e0d4f 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -99,11 +99,14 @@ public abstract class CairoXY
        protected string tcStr = Catalog.GetString("TC");
        protected string countStr = Catalog.GetString("Num");
        protected string jumpTypeStr = Catalog.GetString("Jump type:");
+       protected string font;
 
        public abstract void Do();
 
-       protected void initGraph()
+       protected void initGraph(string font)
        {
+               this.font = font;
+
                totalMargins = outerMargins + innerMargins;
 
                //1 create context
@@ -120,7 +123,7 @@ public abstract class CairoXY
                g.LineWidth = 2;
 
                //4 prepare font
-               g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
+               g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
                g.SetFontSize(textHeight);
 
                black = colorFromRGB(0,0,0);
@@ -473,12 +476,12 @@ public abstract class CairoXY
        protected void writeTextAtRight(double line, string text, bool bold)
        {
                if(bold)
-                       g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
+                       g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
 
                printText(graphWidth, Convert.ToInt32(graphHeight/2 + textHeight*2*line), 0, textHeight, 
text, g, alignTypes.LEFT);
 
                if(bold)
-                       g.SelectFontFace("Helvetica", Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
+                       g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
        }
 
        protected void writeCoordinatesOfMouseClick(double graphX, double graphY, double realX, double realY)
diff --git a/src/gui/encoderGraphObjects.cs b/src/gui/encoderGraphObjects.cs
index d376bdb5..844518ad 100644
--- a/src/gui/encoderGraphObjects.cs
+++ b/src/gui/encoderGraphObjects.cs
@@ -137,7 +137,7 @@ public class EncoderGraphDoPlot
                
                if(layout_encoder_capture_curves_bars != null)
                        layout_encoder_capture_curves_bars.FontDescription =
-                               Pango.FontDescription.FromString ("Courier " + 
preferences.encoderCaptureBarplotFontSize.ToString());
+                               Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize));
        }
 
        public void Start (
@@ -241,13 +241,13 @@ public class EncoderGraphDoPlot
 
                layout_encoder_capture_curves_bars = new Pango.Layout (drawingarea.PangoContext);
                layout_encoder_capture_curves_bars.FontDescription =
-                       Pango.FontDescription.FromString ("Courier " + 
preferences.encoderCaptureBarplotFontSize.ToString());
+                       Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize));
                
                layout_encoder_capture_curves_bars_text = new Pango.Layout (drawingarea.PangoContext);
-               layout_encoder_capture_curves_bars_text.FontDescription = Pango.FontDescription.FromString 
("Courier 10");
+               layout_encoder_capture_curves_bars_text.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(10));
 
                layout_encoder_capture_curves_bars_superbig = new Pango.Layout (drawingarea.PangoContext);
-               layout_encoder_capture_curves_bars_superbig.FontDescription = 
Pango.FontDescription.FromString ("Courier 300");
+               layout_encoder_capture_curves_bars_superbig.FontDescription = 
Pango.FontDescription.FromString (preferences.GetFontTypeWithSize(300));
 
                //defined as drawingarea instead of encoder_capture_signal_drawingarea
                //because the 2nd is null if config.EncoderCaptureShowOnlyBars == TRUE
@@ -450,11 +450,11 @@ public class EncoderGraphDoPlot
                if (data.Count >= 10 && data.Count < 20) {
                        sep = 10;
                        layout_encoder_capture_curves_bars.FontDescription =
-                               Pango.FontDescription.FromString ("Courier " + 
(preferences.encoderCaptureBarplotFontSize -2).ToString());
+                               Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize -2));
                } else if (data.Count >= 20) {
                        sep = 2;
                        layout_encoder_capture_curves_bars.FontDescription =
-                               Pango.FontDescription.FromString ("Courier " + 
(preferences.encoderCaptureBarplotFontSize -4).ToString());
+                               Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize -4));
                        left_margin = 2;
                }
 
@@ -462,12 +462,12 @@ public class EncoderGraphDoPlot
                {
                        sep = 2;
                        layout_encoder_capture_curves_bars.FontDescription =
-                               Pango.FontDescription.FromString ("Courier " + 
(preferences.encoderCaptureBarplotFontSize -4).ToString());
+                               Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize -4));
                        left_margin = 2;
                }
 
                layout_encoder_capture_curves_bars_text.FontDescription =
-                       Pango.FontDescription.FromString ("Courier " + 
preferences.encoderCaptureBarplotFontSize.ToString());
+                       Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(preferences.encoderCaptureBarplotFontSize));
                layout_encoder_capture_curves_bars_text.FontDescription.Weight = Pango.Weight.Bold;
                
                Rectangle rect;
@@ -1073,7 +1073,7 @@ public class EncoderGraphDoPlot
                        //rect = new Rectangle(dLeft, dTop, dWidth, dHeight);
                        rect = new Rectangle(
                                        Convert.ToInt32( (graphWidth/2) - (textWidth/2) -30),
-                                       Convert.ToInt32( (graphHeight/2) - (textHeight/2) ), //textHeight is 
too high on Courier font 300
+                                       Convert.ToInt32( (graphHeight/2) - (textHeight/2) ), //textHeight is 
too high on font 300
                                        textWidth + 60,
                                        textHeight);
                        pixmap.DrawRectangle(pen_black_encoder_capture, true, rect);
@@ -1098,9 +1098,9 @@ public class EncoderGraphDoPlot
        {
                Pango.Layout layout_message = new Pango.Layout (drawingarea.PangoContext);
                if(big)
-                       layout_message.FontDescription = Pango.FontDescription.FromString ("Courier 16");
+                       layout_message.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(16));
                else
-                       layout_message.FontDescription = Pango.FontDescription.FromString ("Courier 10");
+                       layout_message.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(10));
                
                int graphWidth = drawingarea.Allocation.Width;
                int graphHeight = drawingarea.Allocation.Height;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 0f9089d2..6dadc64e 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -245,20 +245,20 @@ public partial class ChronoJumpWindow
                event_execute_eventbox_pulse_time.ModifyBg(Gtk.StateType.Normal, UtilGtk.BLUE_PLOTS); //only 
one serie in pulse, leave blue
                
                layoutSmall = new Pango.Layout (event_execute_drawingarea.PangoContext);
-               layoutSmall.FontDescription = Pango.FontDescription.FromString ("Courier 7");
+               layoutSmall.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(7));
                
                layoutSmallMid = new Pango.Layout (event_execute_drawingarea.PangoContext);
-               layoutSmallMid.FontDescription = Pango.FontDescription.FromString ("Courier 9");
+               layoutSmallMid.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(9));
 
                layoutMid = new Pango.Layout (event_execute_drawingarea.PangoContext);
-               layoutMid.FontDescription = Pango.FontDescription.FromString ("Courier 11");
+               layoutMid.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(11));
 
                layoutBig = new Pango.Layout (event_execute_drawingarea.PangoContext);
-               layoutBig.FontDescription = Pango.FontDescription.FromString ("Courier 14");
+               layoutBig.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(14));
                //layoutBig.Alignment = Pango.Alignment.Center; //doesn't work, see GetPixelSize below
 
                layoutMid_run_simple = new Pango.Layout 
(event_execute_drawingarea_run_simple_double_contacts.PangoContext);
-               layoutMid_run_simple.FontDescription = Pango.FontDescription.FromString ("Courier 9");
+               layoutMid_run_simple.FontDescription = Pango.FontDescription.FromString 
(preferences.GetFontTypeWithSize(9));
        }
        private ExecutingGraphData event_execute_prepareForTest () 
        {
@@ -1361,7 +1361,7 @@ public partial class ChronoJumpWindow
                int lHeight = 1;
                layout.GetPixelSize(out lWidth, out lHeight);
                event_execute_pixmap.DrawLayout (pen_gris, Convert.ToInt32(10 - .5 * lWidth),
-                               Convert.ToInt32(.5 * topMargin -7), layout); //-7 for aligning with Courier 7 
font baseline
+                               Convert.ToInt32(.5 * topMargin -7), layout); //-7 for aligning with font 7 
baseline
        }
 
        private void plotSimulatedMessage(int xcenter, int y, Pango.Layout layout)
@@ -2646,7 +2646,7 @@ public partial class ChronoJumpWindow
        {
                //write text
                layoutSmall.SetMarkup((Math.Round(myValue,3)).ToString());
-               event_execute_pixmap.DrawLayout (myPen, ancho -event_execute_rightMargin, 
(int)calculatePaintHeight(myValue, alto, maxValue, minValue, topMargin, bottomMargin) -7, layoutSmall); //-7 
for aligning (is baseline) (font is Courier 7)
+               event_execute_pixmap.DrawLayout (myPen, ancho -event_execute_rightMargin, 
(int)calculatePaintHeight(myValue, alto, maxValue, minValue, topMargin, bottomMargin) -7, layoutSmall); //-7 
for aligning (is baseline) (font size is 7)
        }
 
        enum guideWidthEnum { FULL, LEFT, RIGHT }
@@ -2675,7 +2675,7 @@ public partial class ChronoJumpWindow
                                        xRight, calculatePaintHeight(guideHeight, alto, maxValue, minValue, 
topMargin, bottomMargin));
                        //write textual data
                        layoutSmall.SetMarkup((Math.Round(guideHeight,1)).ToString());
-                       event_execute_pixmap.DrawLayout (pen_gris, ancho -event_execute_rightMargin, 
(int)calculatePaintHeight(guideHeight, alto, maxValue, minValue, topMargin, bottomMargin) -7, layoutSmall); 
//-7 for aligning with Courier 7 font baseline
+                       event_execute_pixmap.DrawLayout (pen_gris, ancho -event_execute_rightMargin, 
(int)calculatePaintHeight(guideHeight, alto, maxValue, minValue, topMargin, bottomMargin) -7, layoutSmall); 
//-7 for aligning with font 7 baseline
                }
        }
 
diff --git a/src/gui/sendLog.cs b/src/gui/sendLog.cs
index 9b2afe0b..f5fe8e6f 100644
--- a/src/gui/sendLog.cs
+++ b/src/gui/sendLog.cs
@@ -148,7 +148,7 @@ public partial class ChronoJumpWindow
                        SqlitePreferences.Update(SqlitePreferences.LoadLastModeAtStart, true, false);
                } else {
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.START);
-                       new ChronojumpLogo (drawingarea_chronojump_logo, viewport_chronojump_logo, 
preferences.logoAnimatedShow);
+                       new ChronojumpLogo (drawingarea_chronojump_logo, viewport_chronojump_logo, 
preferences.logoAnimatedShow, preferences.fontType.ToString());
                }
        }
 }
diff --git a/src/preferences.cs b/src/preferences.cs
index ea58f6b9..d3da8943 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -43,6 +43,10 @@ public class Preferences
        public enum FontTypes { Courier, Helvetica};
        public FontTypes fontType;
 
+       public string GetFontTypeWithSize(int size) {
+               return string.Format("{0} {1}", fontType, size);
+       }
+
        public bool loadLastSessionAtStart;
        public int lastSessionID;
        public bool loadLastModeAtStart;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]