Html Font Size - Not working

I have an iOSHTMLViewer that I’m displaying some text in:

ltHtml = "<html xmlns=""http://www.w3.org/1999/xhtml"">"
ltHtml = ltHtml + "<head>"
ltHtml = ltHtml + "<meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8"" />"
ltHtml = ltHtml + "<title></title>"
ltHtml = ltHtml + "<style type=""text/css"">"
ltHtml = ltHtml + "body,td,th {"
ltHtml = ltHtml + "font-size: 200%"
ltHtml = ltHtml + "}"
ltHtml = ltHtml + "</style>"
ltHtml = ltHtml + "</head><body>"

...etc

iOSHTMLViewer.Text = ltHtml

No matter what I set Font-Size to, it doesn’t change.

This is an update to an app that was built with the first Xojo iOS version.
If there’s a better way to display blocks of text please tell me.

Thanks

BESIDE XOJO, DID YOU CREATE THAT FILE AS real html that you load in a browser ?

‘;’ is missing after the ‘%’ sign:

https://www.w3schools.com/css/css_font.asp

body { font-size: 100%; }

Maybe this:

ltHtml = ltHtml + "body,td,th {" ltHtml = ltHtml + "font-size: 200%" ltHtml = ltHtml + "-webkit-text-size-adjust: 200%;" ltHtml = ltHtml + "}"

FYI if you have many lines to build your HTML, you will get better performance like this:

[code]Dim tempHTML() As Text
tempHTML.append “<html xmlns=”“http://www.w3.org/1999/xhtml”">"
…etc

Dim ltHTML As Text
ltHTML = Text.Join(tempHTML, “”)[/code]

I’m still not seeing any difference in the font size. Here’s the code now:

ltHtml = ltHtml + "<head>"
ltHtml = ltHtml + "<meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8"" />"
ltHtml = ltHtml + "<title></title>"
ltHtml = ltHtml + "<style type=""text/css"">"
ltHtml = ltHtml + "body,td,th {"
ltHtml = ltHtml + "font-size: 150%;"
ltHtml = ltHtml + "}"
ltHtml = ltHtml + "</style>"

Just out of curiosity… is that the only code that sets font size? If not, it could be overwritten by another stylesheet.

Also, instead of these code snippets, could you show a complete example page from <html> to </html> ?

Oh, and have you tried using something like 16px instead of a percentage?

Here’s all the Code:

ltHtml = "<html xmlns=""http://www.w3.org/1999/xhtml"">"
ltHtml = ltHtml + "<head>"
ltHtml = ltHtml + "<meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8"" />"
ltHtml = ltHtml + "<title></title>"
ltHtml = ltHtml + "<style type=""text/css"">"
ltHtml = ltHtml + "body,td,th {"
ltHtml = ltHtml + "font-size: 150%;"
ltHtml = ltHtml + "}"
ltHtml = ltHtml + "</style>"

ltHtml = ltHtml + "</head><body>"
ltHtml = ltHtml + "<p>The ASPE Tables app is a member benefit. To gain complete functionality you must be an ASPE member in good standing. "
ltHtml = ltHtml + "To learn about all of our member benefits and to join, go to aspe.org/membership by pushing button above.</p>"

ltHtml = ltHtml + "<p>The ASPE Plumbing Engineering and Design Handbook of Tables application is designed to provide accurate and "
ltHtml = ltHtml + "authoritative information for the design and specification of plumbing systems. The publisher makes no guarantees "
ltHtml = ltHtml + "or warranties, expressed or implied, regarding the data and information contained in this application. "
ltHtml = ltHtml + "All data and information are provided with the understanding that the publisher is not engaged in rendering "
ltHtml = ltHtml + "legal, consulting, engineering, or other professional services. If legal, consulting, or engineering advice or "
ltHtml = ltHtml + "other expert assistance is required, the services of a competent professional should be engaged.</p>"
ltHtml = ltHtml + "</body></html>"

@Greg O’Lone

Does anybody have an idea on this?

Did you try Jeremie’s code? Basically add this:

ltHtml = ltHtml + "-webkit-text-size-adjust: 150%;"

after this:

ltHtml = ltHtml + "font-size: 150%;"

Note: I don’t have iOS experience, sorry I can’t help
Edit: I don’t know if you need a space after 150% or before -webkit, or if that makes a difference
Edit2: Thank you Jeremie, I added the semi colon
Edit3: Changed a little to make more sense

Just need a semi colon ;

TI made a small changes and this works.

ltHtml = ltHtml + “font-size: 150%;”
ltHtml = ltHtml + “-webkit-text-size-adjust: 150%;” <<<<<<<<<<< Added this.

The question is "Is this the best way to display a log of text? Also what is a good size?

@Jeremie Leroy

One of the html files has this at the top, and I didn’t have to change the size of the font.