omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    unicode titles for ui buttons?

    Editorial
    2
    5
    3622
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • roosterboy197
      roosterboy197 last edited by

      Trying to add a fancy title to a UI button using Unicode characters.

      vw['btn_underline'].title = u'U\u0332' works and gives me a button with an underlined capital U.

      vw['btn_italic'].title = u'\u1D644' doesn't work. It should give the character MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL I. Instead, it shows Unicode character \u1D64 (LATIN SUBSCRIPT SMALL LETTER U) followed by the number 4.

      What's up with that?

      unicode buttons

      Hmm, picture doesn't show? Here's the link: https://www.dropbox.com/s/9plukw5hloyzz25/unicode_buttons.jpg

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        You can append raw=true to a Dropbox image URL to make it show up inline (I've already edited the post for you).

        As for your actual question: I think you need to use \U0001D644 (the lowercase-u variant expects exactly four hex digits). Unfortunately though, this doesn't seem to work either, it just shows a [?] placeholder in my testing. It seems that the iOS system fonts don't support this character – it also doesn't show up on this page: graphemica U+1D644 (which works fine on OS X).

        1 Reply Last reply Reply Quote 0
        • roosterboy197
          roosterboy197 last edited by

          Well, that's disappointing. Though I guess it is too much to ask for every single obscure Unicode character to be available in the system font. How often are some of them going to be used?

          So, any suggestion for a workaround?

          1 Reply Last reply Reply Quote 0
          • omz
            omz last edited by

            I guess you could just use a regular "I" and set the font to bold-italic, something like this:

            vw['btn_italic'].title = 'I'
            vw['btn_italic'].font = ('HelveticaNeue-BoldItalic', 22)
            

            You may need to experiment with the size to make it look consistent.

            1 Reply Last reply Reply Quote 0
            • roosterboy197
              roosterboy197 last edited by

              Oh, of course! I don't know why I didn't think of that myself. That'll work just fine. Thanks!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors