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
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//src/org/diylc/core/measures/Resistance.java=UTF-8
encoding//src/org/diylc/core/measures/ResistanceUnit.java=UTF-8
@@ -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;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5 -1
View File
@@ -2257,7 +2257,11 @@
</versionNumber>
<releaseDate>2019-01-16 00:00:00.000 CET</releaseDate>
<name></name>
<changes>
<changes>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Fixed the issue with Ohm symbol rendering with some fonts and changed default project font back to "Square721 BT"</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Better color band rendering on resistors and smarter label positioning</description>