Note that there are some explanatory texts on larger screens.

plurals
  1. POBetter HTML Formatting
    primarykey
    data
    text
    <p><strong>EDIT</strong>: I've tried a WebView, which does render the HTML correctly, but it is also very slow, and has visual flicker when new data is loaded. I'm looking into what inside the WebView handles the HTML formatting, as it may be a little faster on its own...</p> <p>I'm making a calculator. To make the input string look real pretty-like, I've been using the <code>HTML.FromHTML()</code> method to handle superscripts powers and subscripts for logs, to be displayed in textViews. For example, the following HTML is handled by your browser and probably looks correct (tested on Chrome and IE):</p> <h1>12+10<sup>log<sub>10</sub>(10<sup>log<sub>10</sub>(33)</sup>)</sup></h1> <p>The subscript 10s for the logs are properly positioned just slightly below their accompanying log text, and nesting does not cause a problem. Now, the <code>HTML.FromHTML()</code> as used in Android 4.0:</p> <p><img src="https://i.stack.imgur.com/rIe8o.png" alt="...fial"></p> <p>Definitely wrong. It appears that the <code>&lt;sub&gt;</code> tag, instead of implying a subscript of the wrapping text style, instead implies a vertical offset from the baseline. This meaning that having one <code>&lt;sup&gt;</code> tag will make the enclosed text offset by 1 constant amount from the baseline, two <code>&lt;sup&gt;</code> tags will cause two of these constant amounts from the baseline, etc. To make things worse, the <code>&lt;sub&gt;</code> tag merely subtracts this constant value. To add insult to injury, instead of the <code>&lt;small&gt;</code> tag scaling things in place, it also scales the offset of any text inside a <code>&lt;sup&gt;</code> or <code>&lt;sub&gt;</code> tag.</p> <p>Is there any way I can make the <code>HTML.FromHTML()</code> method act in the same way as the text is rendered in web browsers? Assuming the answer to this is "not right now" or "you can write your own HTML parser!", does anyone have a suggestion to create similar functionality?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload