SVG support + merge spans + bugfixes

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@170 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2014-09-06 19:19:17 +00:00
parent a336023983
commit a0b76b3729
18 changed files with 212 additions and 130 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.4 (2014-08-13)
* Version 1.4 (2014-09-05)
*
*/
@ -69,6 +69,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes {
public static final String BIBTEX_EXT = ".bib";
public static final String XHTML_EXT = ".html";
public static final String XHTML_MATHML_EXT = ".xhtml";
public static final String HTML5_EXT = ".html";
public static final String PNG_EXT = ".png";
public static final String JPEG_EXT = ".jpg"; // this is the default in graphicx.sty
public static final String GIF_EXT = ".gif";
@ -90,8 +91,8 @@ public final class MIMETypes extends writer2latex.api.MIMETypes {
}
private static final boolean isSVG(byte[] blob) {
// Look for <svg within the first 250 bytes
int m = Math.min(blob.length, 250);
// Look for <svg within the first 500 bytes
int m = Math.min(blob.length, 500);
int n = SVG_SIG.length;
for (int j=0; j<m-n; j++) {
boolean bFound = true;
@ -141,6 +142,7 @@ public final class MIMETypes extends writer2latex.api.MIMETypes {
if (BIBTEX.equals(sMIME)) { return BIBTEX_EXT; }
if (XHTML.equals(sMIME)) { return XHTML_EXT; }
if (XHTML_MATHML.equals(sMIME)) { return XHTML_MATHML_EXT; }
if (HTML5.equals(sMIME)) { return XHTML_EXT; }
return "";
}

View file

@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2012 by Henrik Just
* Copyright: 2002-2014 by Henrik Just
*
* Version 1.4 (2012-04-12)
* Version 1.4 (2014-09-05)
*
* All Rights Reserved.
*/
@ -134,11 +134,15 @@ public class TableReader {
if (bHasRelWidth) {
sRelColWidth[nCol] = (100.0F*nRelColWidth[nCol]/nColSum)+"%";
}
else {
else if (sTableWidth!=null){
// Calculate the relative column width from the absolute column widths
// This may not add up to exactly 100%, but we will live with that
sRelColWidth[nCol] = Misc.divide(sColWidth[nCol], sTableWidth, true);
}
else {
// The table has not width, distribute the columns evenly
sRelColWidth[nCol] = Double.toString(100.0/nCols)+"%";
}
}
// Now determine the actual number of rows and columns