Revision: 20387 http://sourceforge.net/p/jmol/code/20387 Author: hansonr Date: 2015-03-16 19:59:21 +0000 (Mon, 16 Mar 2015) Log Message: ----------- Jmol.___JmolVersion="14.2.13_2015.03.16"
bug fix: label <color ...> xxxx </color> does not calculate stringwidth properly; set labeloffset 0 incorrect Modified Paths: -------------- branches/v14_2/Jmol/src/org/jmol/modelset/Text.java branches/v14_2/Jmol/src/org/jmol/render/LabelsRenderer.java branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties Modified: branches/v14_2/Jmol/src/org/jmol/modelset/Text.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/modelset/Text.java 2015-03-16 18:17:08 UTC (rev 20386) +++ branches/v14_2/Jmol/src/org/jmol/modelset/Text.java 2015-03-16 19:59:21 UTC (rev 20387) @@ -78,7 +78,7 @@ t.bgcolix = bgcolix; return t; } - + public static Text newEcho(Viewer vwr, Font font, String target, short colix, int valign, int align, float scalePixelsPerMicron) { @@ -379,20 +379,28 @@ int subscale = 1; //could be something less than that if (str == null) return 0; - if (str.indexOf("<su") < 0) + if (str.indexOf("<su") < 0 && str.indexOf("<color") < 0) return font.stringWidth(str); int len = str.length(); String s; for (int i = 0; i < len; i++) { if (str.charAt(i) == '<') { - if (i + 4 < len + if (i + 8 <= len && + (str.substring(i, i + 7).equals("<color ") || str.substring(i, i + 8).equals("</color>"))) { + int i1 = str.indexOf(">", i); + if (i1 >= 0) { + i = i1; + continue; + } + } + if (i + 5 <= len && ((s = str.substring(i, i + 5)).equals("<sub>") || s .equals("<sup>"))) { i += 4; f = subscale; continue; } - if (i + 5 < len + if (i + 6 <= len && ((s = str.substring(i, i + 6)).equals("</sub>") || s .equals("</sup>"))) { i += 5; Modified: branches/v14_2/Jmol/src/org/jmol/render/LabelsRenderer.java =================================================================== --- branches/v14_2/Jmol/src/org/jmol/render/LabelsRenderer.java 2015-03-16 18:17:08 UTC (rev 20386) +++ branches/v14_2/Jmol/src/org/jmol/render/LabelsRenderer.java 2015-03-16 19:59:21 UTC (rev 20387) @@ -196,7 +196,7 @@ } boolean isSimple = isLeft && (imageFontScaling == 1 && scalePixelsPerMicron == 0 - && label.indexOf("|") < 0 && label.indexOf("<su") < 0); + && label.indexOf("|") < 0 && label.indexOf("<su") < 0 && label.indexOf("<co") < 0); if (isSimple) { boolean doPointer = ((pointer & JC.POINTER_ON) != 0); short pointerColix = ((pointer & JC.POINTER_BACKGROUND) != 0 Modified: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-16 18:17:08 UTC (rev 20386) +++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties 2015-03-16 19:59:21 UTC (rev 20387) @@ -4,8 +4,13 @@ # THIS IS THE RELEASE BRANCH # BUG FIXES ONLY, PLEASE -Jmol.___JmolVersion="14.2.13_2015.03.13" +Jmol.___JmolVersion="14.2.13_2015.03.16" +bug fix: label <color ...> xxxx </color> does not calculate stringwidth properly; set labeloffset 0 incorrect + +JmolVersion="14.2.13_2015.03.13" +released + bug fix: fonts too small with antialiasDisplay (14.2.12) bug fix: PNG generation uses iTXt instead of tEXt; problems with diacritical marks (German translation of "March" month in creation time) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits