• Login
Community
  • Login

separate fonts for English and Hindi text

Scheduled Pinned Locked Moved General Discussion
complex scriptshindimultiple fonts
4 Posts 3 Posters 5.5k Views
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.
  • V
    V S Rawat
    last edited by Nov 12, 2017, 6:36 PM

    of course, we can set a font in menu - Settings - Style Configurator - Global Styles.

    But that allows only a single font.

    often different languages look good in different fonts.

    For me, I would like English text to be in Times New Roman, and Hindi (Devanagari) text in Arial Unicoce MS.

    But, I don’t have option to have two fonts like that.

    Have a look at MS word how they allow setting two fonts for diffrent languages under complex scripts.

    may be something can be thought up, as a text editor is only having one font because txt file doesn’t have coding for different fonts, but language itself is a coding, if we can somehow define different fonts for “character code range”, it is possible.

    Thanks.

    Rawat

    M 1 Reply Last reply Nov 12, 2017, 11:31 PM Reply Quote 0
    • D
      dail
      last edited by Nov 12, 2017, 7:24 PM

      For me, I would like English text to be in Times New Roman, and Hindi (Devanagari) text in Arial Unicoce MS.

      Scintilla (which is what Notepad++ uses internally) does not parse text this way. It uses a lexer to figure out what the syntax highlighting needs to do. You can however specify different font’s based on the style (such as comments) and through a scripting plugin can also specify character sets for those styles.

      1 Reply Last reply Reply Quote 1
      • M
        Mikhail V @V S Rawat
        last edited by Nov 12, 2017, 11:31 PM

        @V-S-Rawat said:

        may be something can be thought up, as a text editor is only having one font because txt file doesn’t have coding for different fonts, but language itself is a coding, if we can somehow define different fonts for “character code range”, it is possible.

        One way to achieve similar effect is to use “User defined language”.
        Go to Languages-> define your language…
        For example you want to apply this to .txt files: “create new”
        then input “txt” in the “Ext.” box.
        Then go to “keywords” section. In one of empty boxes, say “1st group” you input all the characters (simply space-separated) you want to show in different font or style. Then tick “Prefix mode” checkbox on. On same group press “styler button” to adjust style.

        This should (partially) work, at least it worked for me with Cyrillic letters.
        However it is just a tweak and there may be side effects and glitches, because
        of punctuation with latin codes, etc.

        1 Reply Last reply Reply Quote 1
        • V
          V S Rawat
          last edited by Nov 16, 2017, 3:28 AM

          Insightful method. Really creative. I couldn’t think of it myself.

          though, for a lazy like me, it is too much work, so I would avoid doing all this.

          Thanks a lot for giving such a good method though.

          Rawat

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors