Fixed the issue with Ohm symbol rendering with some fonts and changed

default project font back to "Square721 BT"
This commit is contained in:
Branislav Stojkovic
2019-01-17 00:01:51 +01:00
parent 5b2a9c0e43
commit f1ccfa86c0
9 changed files with 12 additions and 5 deletions
@@ -61,7 +61,7 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
public static Color SELECTION_COLOR = Color.red;
public static Color LABEL_COLOR = Color.black;
public static Color LABEL_COLOR_SELECTED = Color.red;
public static Font LABEL_FONT = new Font("Lucida Console", Font.PLAIN, 14);
public static Font LABEL_FONT = new Font("Square721 BT", Font.PLAIN, 14);
public static Color METAL_COLOR = Color.decode("#759DAF");
public static Color LIGHT_METAL_COLOR = Color.decode("#EEEEEE");
public static Color COPPER_COLOR = Color.decode("#DA8A67");
@@ -53,7 +53,7 @@ public class Project implements Serializable {
public static Size DEFAULT_WIDTH = new Size(29d, SizeUnit.cm);
public static Size DEFAULT_HEIGHT = new Size(21d, SizeUnit.cm);
public static Size DEFAULT_GRID_SPACING = new Size(0.1d, SizeUnit.in);
public static Font DEFAULT_FONT = new Font("Lucida Console", Font.PLAIN, 14);
public static Font DEFAULT_FONT = new Font("Square721 BT", Font.PLAIN, 14);
private VersionNumber fileVersion;
@@ -109,7 +109,7 @@ public class Resistance extends AbstractMeasure<ResistanceUnit> {
}
public static Resistance parseResistance(String value) {
value = value.replace("*", "").replace("R", "\u2126");
value = value.replace("*", "").replace("R", "Ω");
for (ResistanceUnit unit : ResistanceUnit.values()) {
if (value.toLowerCase().endsWith(unit.toString().toLowerCase())) {
value = value.substring(0, value.length() - unit.toString().length()).trim();
@@ -23,7 +23,7 @@ package org.diylc.core.measures;
public enum ResistanceUnit implements Unit {
R(1, "\u2126"), K(1e3, "K"), M(1e6, "M");
R(1, "Ω"), K(1e3, "K"), M(1e6, "M");
double factor;
String display;