Search code examples
windowsunicodensissuperscript

Superscript text formatting for NSIS


I am developing an NSIS installer for a product that has a superscript in its name. Is it possible to encode superscript text in the installer script?

In particular, I'd like to get the Name, BrandingText and Caption to display the superscript.

I would be willing to switch to the NSIS Unicode build if that would definitively solve the issue.


Solution

  • ᴵ ᶜᵒᵘˡᵈⁿ'ᵗ ʰᵉˡᵖ ⁱᵗ, ᴵ ʲᵘˢᵗ ʰᵃᵈ ᵗᵒ ʷʳⁱᵗᵉ ˢᵘᵖᵉʳˢᶜʳⁱᵖᵗᵐᵉ.ᵖʸ ʷʰᵉⁿ ᴵ ᶠᵒᵘⁿᵈ ᵃˡˡ ᵗʰⁱˢ!

    ᴬˢ ˢᵘᶜʰ, ⁿᵒ. ᴴᵒʷᵉᵛᵉʳ, ᵗʰᵉʳᵉ ᵃʳᵉ ᵁⁿⁱᶜᵒᵈᵉ ᵍˡʸᵖʰˢ ᶠᵒʳ ᶜᵉʳᵗᵃⁱⁿ ᶜʰᵃʳᵃᶜᵗᵉʳˢ. ᴴᵉʳᵉ ᵃʳᵉ ᵗʰᵉ ᶜʰᵃʳᵃᶜᵗᵉʳˢ ʸᵒᵘ'ʳᵉ ᵐᵒˢᵗ ˡⁱᵏᵉˡʸ ᵗᵒ ʷᵃⁿᵗ, ᵗᵃᵏᵉⁿ ᶠʳᵒᵐ ʰᵗᵗᵖ://ᵉⁿ.ʷⁱᵏⁱᵖᵉᵈⁱᵃ.ᵒʳᵍ/ʷⁱᵏⁱ/Sᵘᵇˢᶜʳⁱᵖᵗ_ᵃⁿᵈ_ˢᵘᵖᵉʳˢᶜʳⁱᵖᵗ#ᵁⁿⁱᶜᵒᵈᵉ:

    ᴺᵘᵐᵇᵉʳˢ ᵃⁿᵈ ᶜᵒᵐᵐᵒⁿ ᵐᵃᵗʰᵉᵐᵃᵗⁱᶜᵃˡ ˢʸᵐᵇᵒˡˢ: ⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾

    ᴸᵒʷᵉʳᶜᵃˢᵉ ᵃˡᵖʰᵃᵇᵉᵗ ᵉˣᶜᵉᵖᵗ q: ᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ

    ᴸⁱᵐⁱᵗᵉᵈ ᵘᵖᵖᵉʳᶜᵃˢᵉ ˡᵃᵗⁱⁿ ᵃˡᵖʰᵃᵇᵉᵗ: ᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ⱽ ᵂ ⁽ⁿᵒ C, F, Q, S, X, Y, Z⁾

    ᴰᵒⁿ'ᵗ ᵃˢᵏ ᵐᵉ ʷʰʸ ᶜᵉʳᵗᵃⁱⁿ ᶜʰᵃʳᵃᶜᵗᵉʳˢ ʷᵉʳᵉ ᵒᵐⁱᵗᵗᵉᵈ; ᴵ ʰᵃᵛᵉ ⁿᵒ ⁱᵈᵉᵃ ʷʰᵃᵗˢᵒᵉᵛᵉʳ.

    ᴬˢ ʸᵒᵘ ᵐᵃʸ ⁿᵒᵗⁱᶜᵉ ⁽ᵗʳʸ ᶻᵒᵒᵐⁱⁿᵍ ⁱⁿ ᵃⁿᵈ ᵒᵘᵗ ᵃ ᵇⁱᵗ⁾, ᵗʰᵉ ᵖʳᵉᶜⁱˢᵉ ʳᵉⁿᵈᵉʳⁱⁿᵍ ᵒᶠ ᵗʰᵉ ᵍˡʸᵖʰˢ ᵛᵃʳⁱᵉˢ ᵇᵃˢᵉᵈ ᵒⁿ ᵗʰᵉ ᶠᵒⁿᵗ ᵘˢᵉᵈ ᵗᵒ ʳᵉⁿᵈᵉʳ ᵗʰᵉᵐ ᵃⁿᵈ ᵗʰᵉ ˢⁱᶻᵉ ᵗʰᵉʸ'ʳᵉ ʳᵉⁿᵈᵉʳᵉᵈ ᵃᵗ. ᵀʰᵉʳᵉᶠᵒʳᵉ ᴵ'ᵈ ᵃᵈᵛⁱˢᵉ ʸᵒᵘ ᵗᵒ ᵗʳʸ ʳᵘⁿⁿⁱⁿᵍ ʸᵒᵘʳ ⁱⁿˢᵗᵃˡˡᵉʳ ᵒⁿ ᵇᵒᵗʰ ⁽²⁰⁰⁰ ᵒʳ Xᴾ⁾ ᵃⁿᵈ ⁽ⱽⁱˢᵗᵃ ᵒʳ ⁷⁾, ᵖʳᵉᶠᵉʳᵃᵇˡʸ ʷⁱᵗʰ ⁿᵒʳᵐᵃˡ ᵃⁿᵈ ˡᵃʳᵍᵉ ᶠᵒⁿᵗ ˢⁱᶻᵉˢ, ˢᵒ ᵗʰᵃᵗ ʸᵒᵘ ᵍᵉᵗ ᵃ ᶠᵉᵉˡ ᵒᶠ ʷʰᵃᵗ ⁱᵗ'ˢ ᵍᵒⁱⁿᵍ ᵗᵒ ˡᵒᵒᵏ ˡⁱᵏᵉ ⁻ ʸᵒᵘ ᵐᵃʸ ᵈᵉᶜⁱᵈᵉ ⁱᵗ ˡᵒᵒᵏˢ ᵇᵉᵗᵗᵉʳ ⁿᵒᵗ ˢᵘᵖᵉʳˢᶜʳⁱᵖᵗ.


    English translation:

    As such, no. However, there are Unicode glyphs for certain characters. Here are the characters you're most likely to want, taken from http://en.wikipedia.org/wiki/Subscript_and_superscript#Unicode:

    Numbers and common mathematical symbols: ⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾

    Lowercase alphabet except q: ᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ

    Limited uppercase latin alphabet: ᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ⱽ ᵂ (no C, F, Q, S, X, Y, Z)

    Don't ask me why certain characters were omitted; I have no idea whatsoever.

    As you may notice (try zooming in and out a bit), the precise rendering of the glyphs varies based on the font used to render them and the size they're rendered at. Therefore I'd advise you to try running your installer on both (2000 or XP) and (Vista or 7), preferably with normal and large font sizes, so that you get a feel of what it's going to look like - you may decide it looks better not superscript.

    ⁽ᵀʰᵃᵗ ʷᵃˢ ʷᵒʳʳʸⁱⁿᵍˡʸ ᵉⁿʲᵒʸᵃᵇˡᵉ.⁾


    Summary: these glyphs of themselves will work fine in Unicode NSIS, but check to see how good font support is.