Aesthetics in the middle of text

PennController for IBEX Forums Support Aesthetics in the middle of text

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4084
    leaena
    Participant

    Hi Jeremy,

            newText("practiceinstructions", "We would not typically describe this scene using this sentence, because \"at least two\" leads us to expect more than two apples. You should ")
                .settings.after(newText("negative", "not").settings.italic())
                .settings.after(newText("number", " rate it a 6 or 7."))
            ,

    Something is removing the leading and trailing white space, which I imagine is generally a thing that is desired. I tried adding more white space and escaping the white space, too, but it did not work. Is there a way to have a sub-section of a line of text in italics (or other style) without the spaces in between getting removed?

    Thank you!
    Leo

    #4085
    Jeremy
    Keymaster

    Hi Leo,

    You could use HTML tags to apply a style to a portion of your text. Usually browsers render <em> as italics, and the tag <i> is sort of deprecated. The most reliable, universal solution would probably be <span style='font-style: italic;'> like this:

    newText("practiceinstructions", "We would not typically describe this scene using this sentence, because \"at least two\" leads us to expect more than two apples. You should <span style='font-style: italic;'>not</span> rate it as 6 or 7.")

    More generally though, when you want a trailing white space, you can add a non-breaking space using &nbsp;

    Jeremy

    • This reply was modified 4 years, 8 months ago by Jeremy. Reason: Missed a '
    #4097
    leaena
    Participant

    Hi Jeremy,

    Thanks for your reply. Unfortunately the code you posted does not work. It displays and otherwise functions, but the text stops after “should”.

    Best,
    Leo

    #4101
    Jeremy
    Keymaster

    Sorry, missed a ' between italic; and >

    Jeremy

    #4102
    leaena
    Participant

    Apologies – it was just missing an end ‘. Thank you! It works indeed!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.