From e6fcf546b64c2140f815bace7464631b4941fc5c Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Tue, 16 May 2023 14:48:03 +0100 Subject: [PATCH] Replace "modern" font with "sans-serif" (#901) This should be equivalent for currently released Enable, but will keep things unchanged after [enable #977](https://github.com/enthought/enable/pull/977) is merged. --- chaco/axis.py | 4 ++-- chaco/examples/demo/basic/cmap_scatter.py | 4 ++-- chaco/examples/demo/basic/cmap_segment_plot.py | 4 ++-- chaco/examples/demo/basic/discrete_cmap_scatter.py | 4 ++-- chaco/examples/demo/basic/zoomable_colorbar.py | 4 ++-- chaco/examples/demo/data_labels.py | 6 +++--- chaco/label.py | 2 +- chaco/overlays/legend.py | 2 +- chaco/overlays/text_box_overlay.py | 2 +- chaco/overlays/text_grid_overlay.py | 2 +- chaco/overlays/tooltip.py | 2 +- chaco/plots/text_plot.py | 2 +- chaco/plots/text_plot_1d.py | 2 +- chaco/tools/regression_lasso.py | 2 +- docs/source/user_manual/basic_elements/overlays.rst | 4 ++-- examples/user_guide/plot_types/create_plot_snapshots.py | 4 ++-- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/chaco/axis.py b/chaco/axis.py index 9635b8fe5..959f29f06 100644 --- a/chaco/axis.py +++ b/chaco/axis.py @@ -87,7 +87,7 @@ class PlotAxis(AbstractOverlay): title = Str() # May want to add PlotLabel option #: The font of the title. - title_font = KivaFont("modern 12") + title_font = KivaFont("sans-serif 12") #: The spacing between the axis line and the title title_spacing = Union(Constant("auto"), Float) @@ -105,7 +105,7 @@ class PlotAxis(AbstractOverlay): tick_color = ColorTrait("black") #: The font of the tick labels. - tick_label_font = KivaFont("modern 10") + tick_label_font = KivaFont("sans-serif 10") #: The color of the tick labels. tick_label_color = ColorTrait("black") diff --git a/chaco/examples/demo/basic/cmap_scatter.py b/chaco/examples/demo/basic/cmap_scatter.py index 3a17f5e40..f4475ce0e 100644 --- a/chaco/examples/demo/basic/cmap_scatter.py +++ b/chaco/examples/demo/basic/cmap_scatter.py @@ -72,8 +72,8 @@ def _create_plot_component(): plot.padding = 50 plot.x_grid.visible = False plot.y_grid.visible = False - plot.x_axis.font = "modern 16" - plot.y_axis.font = "modern 16" + plot.x_axis.font = "sans-serif 16" + plot.y_axis.font = "sans-serif 16" # Right now, some of the tools are a little invasive, and we need the # actual ColomappedScatterPlot object to give to them diff --git a/chaco/examples/demo/basic/cmap_segment_plot.py b/chaco/examples/demo/basic/cmap_segment_plot.py index 3afec6072..cafc7ef30 100644 --- a/chaco/examples/demo/basic/cmap_segment_plot.py +++ b/chaco/examples/demo/basic/cmap_segment_plot.py @@ -75,8 +75,8 @@ def _create_plot_component(): plot.padding = 50 plot.x_grid.visible = False plot.y_grid.visible = False - plot.x_axis.font = "modern 16" - plot.y_axis.font = "modern 16" + plot.x_axis.font = "sans-serif 16" + plot.y_axis.font = "sans-serif 16" # Right now, some of the tools are a little invasive, and we need the # actual ColomappedSegmentPlot object to give to them diff --git a/chaco/examples/demo/basic/discrete_cmap_scatter.py b/chaco/examples/demo/basic/discrete_cmap_scatter.py index 9bcd8e690..3d301a20b 100644 --- a/chaco/examples/demo/basic/discrete_cmap_scatter.py +++ b/chaco/examples/demo/basic/discrete_cmap_scatter.py @@ -73,8 +73,8 @@ def _create_plot_component(): plot.padding = 50 plot.x_grid.visible = False plot.y_grid.visible = False - plot.x_axis.font = "modern 16" - plot.y_axis.font = "modern 16" + plot.x_axis.font = "sans-serif 16" + plot.y_axis.font = "sans-serif 16" # Right now, some of the tools are a little invasive, and we need the # actual ColomappedScatterPlot object to give to them diff --git a/chaco/examples/demo/basic/zoomable_colorbar.py b/chaco/examples/demo/basic/zoomable_colorbar.py index 7f2c979a4..d1a092a11 100644 --- a/chaco/examples/demo/basic/zoomable_colorbar.py +++ b/chaco/examples/demo/basic/zoomable_colorbar.py @@ -69,8 +69,8 @@ def _create_plot_component(): plot.padding = 50 plot.x_grid.visible = False plot.y_grid.visible = False - plot.x_axis.font = "modern 16" - plot.y_axis.font = "modern 16" + plot.x_axis.font = "sans-serif 16" + plot.y_axis.font = "sans-serif 16" # Add pan and zoom to the plot plot.tools.append(PanTool(plot, constrain_key="shift")) diff --git a/chaco/examples/demo/data_labels.py b/chaco/examples/demo/data_labels.py index 213281b03..9ac51f6c6 100644 --- a/chaco/examples/demo/data_labels.py +++ b/chaco/examples/demo/data_labels.py @@ -104,7 +104,7 @@ def _plot_default(self): marker_color="blue", marker_line_color="transparent", marker="diamond", - font="modern 14", + font="sans-serif 14", arrow_visible=False, ) plot.overlays.append(label2) @@ -132,7 +132,7 @@ def _plot_default(self): label_style="bubble", label_text="Something interesting", label_format="at x=%(x).2f, y=%(y).2f", - font="modern 18", + font="sans-serif 18", bgcolor=(1, 1, 0.75, 1), ) plot.overlays.append(label4) @@ -155,7 +155,7 @@ def _plot_default(self): label_text="Label with\narrow_min_length=20", border_visible=False, arrow_min_length=20, - font="modern 14", + font="sans-serif 14", bgcolor=(0.75, 0.75, 0.75, 1), ) plot.overlays.append(label5) diff --git a/chaco/label.py b/chaco/label.py index 7a0f1460b..79b1cd5f3 100644 --- a/chaco/label.py +++ b/chaco/label.py @@ -63,7 +63,7 @@ class Label(HasTraits): border_visible = Bool(True) #: The font of the label text. - font = KivaFont("modern 10") + font = KivaFont("sans-serif 10") #: Number of pixels of margin around the label, for both X and Y dimensions. margin = Int(2) diff --git a/chaco/overlays/legend.py b/chaco/overlays/legend.py index 2122ccf08..38aaf7540 100644 --- a/chaco/overlays/legend.py +++ b/chaco/overlays/legend.py @@ -91,7 +91,7 @@ class Legend(AbstractOverlay): """A legend for a plot.""" #: The font to use for the legend text. - font = KivaFont("modern 12") + font = KivaFont("sans-serif 12") #: The amount of space between the content of the legend and the border. border_padding = Int(10) diff --git a/chaco/overlays/text_box_overlay.py b/chaco/overlays/text_box_overlay.py index 97221e2c9..e36310047 100644 --- a/chaco/overlays/text_box_overlay.py +++ b/chaco/overlays/text_box_overlay.py @@ -31,7 +31,7 @@ class TextBoxOverlay(AbstractOverlay): text = Str #: The font to use for the text. - font = KivaFont("modern 12") + font = KivaFont("sans-serif 12") #: The background color for the box (overrides AbstractOverlay). bgcolor = ColorTrait("transparent") diff --git a/chaco/overlays/text_grid_overlay.py b/chaco/overlays/text_grid_overlay.py index fcba338c0..7b1f2ed18 100644 --- a/chaco/overlays/text_grid_overlay.py +++ b/chaco/overlays/text_grid_overlay.py @@ -37,6 +37,6 @@ def _text_grid_changed(self, old, new): self.add(new) def _text_grid_default(self): - text_grid = TextGrid(font="modern 12", cell_border_width=0) + text_grid = TextGrid(font="sans-serif 12", cell_border_width=0) self.add(text_grid) return text_grid diff --git a/chaco/overlays/tooltip.py b/chaco/overlays/tooltip.py index 098253c85..d2784cb43 100644 --- a/chaco/overlays/tooltip.py +++ b/chaco/overlays/tooltip.py @@ -31,7 +31,7 @@ class ToolTip(AbstractOverlay): """An overlay that is a toolip.""" #: The font to render the tooltip. - font = KivaFont("modern 10") + font = KivaFont("sans-serif 10") #: The color of the text in the tooltip text_color = black_color_trait diff --git a/chaco/plots/text_plot.py b/chaco/plots/text_plot.py index 5303accaf..9c70e0040 100644 --- a/chaco/plots/text_plot.py +++ b/chaco/plots/text_plot.py @@ -34,7 +34,7 @@ class TextPlot(BaseXYPlot): text = Instance(ArrayDataSource) #: The font of the tick labels. - text_font = KivaFont("modern 10") + text_font = KivaFont("sans-serif 10") #: The color of the tick labels. text_color = black_color_trait diff --git a/chaco/plots/text_plot_1d.py b/chaco/plots/text_plot_1d.py index eeb7ff20f..86d58ed4a 100644 --- a/chaco/plots/text_plot_1d.py +++ b/chaco/plots/text_plot_1d.py @@ -34,7 +34,7 @@ class TextPlot1D(Base1DPlot): value = Instance(ArrayDataSource) #: The font of the tick labels. - text_font = KivaFont("modern 10") + text_font = KivaFont("sans-serif 10") #: The color of the tick labels. text_color = black_color_trait diff --git a/chaco/tools/regression_lasso.py b/chaco/tools/regression_lasso.py index b5e1e7b30..f8045a73a 100644 --- a/chaco/tools/regression_lasso.py +++ b/chaco/tools/regression_lasso.py @@ -65,7 +65,7 @@ class RegressionOverlay(LassoOverlay): kw=dict( bgcolor="white", border_color="black", - font="modern 14", + font="sans-serif 14", border_width=1, ), ) diff --git a/docs/source/user_manual/basic_elements/overlays.rst b/docs/source/user_manual/basic_elements/overlays.rst index 2e220805d..24ef43c15 100644 --- a/docs/source/user_manual/basic_elements/overlays.rst +++ b/docs/source/user_manual/basic_elements/overlays.rst @@ -45,8 +45,8 @@ given an X-Y plot renderer, ``plot``, we can define a new x-axis as: :: AXIS_DEFAULTS = { 'axis_line_weight': 2, 'tick_weight': 2, - 'tick_label_font': 'modern 16', - 'title_font': 'modern 20', + 'tick_label_font': 'sans-serif 16', + 'title_font': 'sans-serif 20', } x_axis = PlotAxis( diff --git a/examples/user_guide/plot_types/create_plot_snapshots.py b/examples/user_guide/plot_types/create_plot_snapshots.py index d99d9c1ba..faa8b05fb 100644 --- a/examples/user_guide/plot_types/create_plot_snapshots.py +++ b/examples/user_guide/plot_types/create_plot_snapshots.py @@ -59,8 +59,8 @@ AXIS_DEFAULTS = { "axis_line_weight": AXIS_WIDTH, "tick_weight": AXIS_WIDTH, - "tick_label_font": "modern 16", - "title_font": "modern 20", + "tick_label_font": "sans-serif 16", + "title_font": "sans-serif 20", }