support unicode text in colorbar

This commit is contained in:
wyq 2023-12-04 21:14:03 +08:00
parent 0de44796f8
commit eb4d113754
2 changed files with 16 additions and 15 deletions

View File

@ -1323,6 +1323,7 @@ public class GLPlot extends Plot {
this.updateMatrix(gl); this.updateMatrix(gl);
if (!this.legends.isEmpty()) { if (!this.legends.isEmpty()) {
ChartColorBar legend = (ChartColorBar) this.legends.get(0); ChartColorBar legend = (ChartColorBar) this.legends.get(0);
updateTextRender(legend.getTickLabelFont());
if (legend.getLegendScheme().getColorMap() == null) if (legend.getLegendScheme().getColorMap() == null)
this.drawLegend(gl, legend); this.drawLegend(gl, legend);
else else
@ -3985,6 +3986,7 @@ public class GLPlot extends Plot {
//Draw label //Draw label
ChartText label = legend.getLabel(); ChartText label = legend.getLabel();
if (label != null) { if (label != null) {
this.updateTextRender(legend.getLabelFont());
label.setColor(legend.getTickColor()); label.setColor(legend.getTickColor());
float sx, sy; float sx, sy;
float yShift = this.tickSpace * this.dpiScale; float yShift = this.tickSpace * this.dpiScale;
@ -4115,6 +4117,7 @@ public class GLPlot extends Plot {
//Draw label //Draw label
ChartText label = legend.getLabel(); ChartText label = legend.getLabel();
if (label != null) { if (label != null) {
this.updateTextRender(legend.getLabelFont());
label.setColor(legend.getTickColor()); label.setColor(legend.getTickColor());
float sx, sy; float sx, sy;
float yShift = this.tickSpace * this.dpiScale; float yShift = this.tickSpace * this.dpiScale;

View File

@ -1,32 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile"> <MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\chart\axis"> <Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\no_opengl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\quiver"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamplot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamslice"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamslice"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\3d_earth"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\3d_earth"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\axis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\city"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\axis"/>
</Path> </Path>
<File> <File>
<OpenedFiles> <OpenedFiles>
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\radar\radar_cma_base_grid_3d.py"/> <OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\plot3_multi_color_chinese.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour\contour_log_1.py"/> <OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text\text3_chinese.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text\text_latex.py"/>
</OpenedFiles> </OpenedFiles>
<RecentFiles> <RecentFiles>
<RecentFile File="D:\Working\MIScript\Jython\mis\io\radar\radar_cma_base_grid_3d.py"/> <RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\plot\plot3_multi_color_chinese.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\contour\contour_log_1.py"/> <RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text\text3_chinese.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\text\text_latex.py"/>
</RecentFiles> </RecentFiles>
</File> </File>
<Font> <Font>
@ -34,5 +32,5 @@
</Font> </Font>
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/> <LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
<Figure DoubleBuffering="true"/> <Figure DoubleBuffering="true"/>
<Startup MainFormLocation="-7,0" MainFormSize="1366,803"/> <Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
</MeteoInfo> </MeteoInfo>