Changeset 692


Ignore:
Timestamp:
01/14/14 16:27:17 (10 years ago)
Author:
ngw8
Message:

Partially fixed web parsers inability to convert unicode characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/WebParser.java

    r691 r692  
    9999                                                                // MessageBay.displayMessage("Finished loading page");
    100100                                                                System.out.println("Parsing page!");
    101                                                                 JavaFX.WebEngineExecuteScript.invoke(webEngine, "window.resizeTo(800, 800)");
     101                                                                        JavaFX.WebEngineExecuteScript.invoke(webEngine, "window.resizeTo(800, 800);");
    102102                                                                parsePage(webEngine, frame);
    103103                                                                System.out.println("Parsed page!");
     
    137137
    138138                                                Object window = JavaFX.WebEngineExecuteScript.invoke(webEngine, "window");
    139                                                
    140                                                 JavaFX.WebEngineExecuteScript.invoke(webEngine, ""
    141  + "var css = 'a * { outline: 0.1px outset rgba(9,9,9,0.001); }';" // TODO
    142                                                                 + "var head = document.head;"
    143                                                                 + "var style = document.createElement('style');"
    144                                                                 + "style.id = 'expediteeparser';"
    145 
    146                                                                 + "style.appendChild(document.createTextNode(css));"
    147 
    148                                                                 + "head.appendChild(style);"
    149                                                                 );
    150139
    151140                                                frame.setBackgroundColor(rgbStringToColor((String) JavaFX.JSObjectCall.invoke(JavaFX.JSObjectCall.invoke(window, "getComputedStyle", new Object[] { doc }), "getPropertyValue",
     
    344333                                                                                for (int j = 0; j < typefaces.length && !fontFound; j++) {
    345334                                                                                        if (typefaces[j].toLowerCase().equals("sans-serif")) {
    346                                                                                                 typefaces[j] = "Arial";
     335                                                                                                typefaces[j] = "Arial Unicode MS";
    347336                                                                                        } else if (typefaces[j].toLowerCase().equals("serif")) {
    348337                                                                                                typefaces[j] = "Times New Roman";
     338                                                                                        } else if ((typefaces[j].toLowerCase().equals("arial"))) {
     339                                                                                                // Have to use Arial Unicode, otherwise unicode characters display incorrectly
     340                                                                                                typefaces[j] = "Arial Unicode MS";
    349341                                                                                        }
    350342                                                                                       
     
    599591         * @param imgSrc
    600592         *            URL of the image to add
     593         * @param linkUrl
     594         *            Absolute URL that the image should link to when clicked
    601595         * @param frame
    602596         *            Frame to add the image to
Note: See TracChangeset for help on using the changeset viewer.