Inputting special symbols

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Inputting special symbols

seng_liang
Hi, I'm using Lilypond 2.7.x series for Windows 98 and I would like to know
how can we input special characters into Lilypond using standard word
editors like Notepad? I would like to put the word "piu forte" in a text
markup, but with a backslash on top of the u in "piu". I tried using Alt+151
(the symbol ù) to enter that character but it was not shown in the pdf
output. Is there a way to do this?
Thanks in advance.




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Mats Bengtsson-6
I don't know about the capabilities of NotePad in Windows 98, but on
newer Windows versions, you can easily choose to save the file as UTF-8,
which is what LilyPond needs.

   /Mats

liang seng wrote:

> Hi, I'm using Lilypond 2.7.x series for Windows 98 and I would like to
> know how can we input special characters into Lilypond using standard
> word editors like Notepad? I would like to put the word "piu forte" in
> a text markup, but with a backslash on top of the u in "piu". I tried
> using Alt+151 (the symbol ù) to enter that character but it was not
> shown in the pdf output. Is there a way to do this?
> Thanks in advance.
>
>
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-user


--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

fiëé visuëlle
In reply to this post by seng_liang

Am 2006-01-02 um 12:43 schrieb liang seng:

> Hi, I'm using Lilypond 2.7.x series for Windows 98 and I would like  
> to know how can we input special characters into Lilypond using  
> standard word editors like Notepad? I would like to put the word  
> "piu forte" in a text markup, but with a backslash on top of the u  
> in "piu". I tried using Alt+151 (the symbol ù) to enter that  
> character but it was not shown in the pdf output. Is there a way to  
> do this?

This is a FAQ.
You need to use an editor that is able to handle UTF-8 encoding  
(preferably without Byte Order Mark).


Greetlings from Lake Constance
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
http://www.cacert.org (I'm an assurer)




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

seng_liang
In reply to this post by Mats Bengtsson-6
Hi, does this mean that I cannot input these special characters using
Windows 98 platform and using Notepad? Are there other alternatives?




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Mats Bengtsson-6
Did you read the section called "Editor support" in the manual?
Especially, jEdit seems like a good alternative on all platforms.

   /Mats

liang seng wrote:

> Hi, does this mean that I cannot input these special characters using
> Windows 98 platform and using Notepad? Are there other alternatives?
>
>
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-user


--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

seng_liang
In reply to this post by Mats Bengtsson-6
Hi, do you mean that on Windows XP, the word editors (like Notepad) are able
to save text files in utf-8 code? (Since I don't have WinXP, I don't know if
that is possible) I may have to borrow a colleague's computer with Win XP to
continue my work.




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Graham Percival-2

On 3-Jan-06, at 7:26 PM, liang seng wrote:

> Hi, do you mean that on Windows XP, the word editors (like Notepad)
> are able to save text files in utf-8 code? (Since I don't have WinXP,
> I don't know if that is possible) I may have to borrow a colleague's
> computer with Win XP to continue my work.

Why not just look for another editor?  I'm sure you can find a text
editor for windows (whatever version you use) that can save as utf-8.  
I'm certain that jedit can do this, for example.

Cheers,
- Graham



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
stk
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

stk
In reply to this post by seng_liang
> Hi, does this mean that I cannot input these special characters using
> Windows 98 platform and using Notepad? Are there other alternatives?

I think there are hardly any people on this list who use W98 and Notepad.
However, I do, and there is a work-around.

I will e-mail you directly a file with a table showing the pair of
characters you have to insert in your Notepad file in order to get any
specific Latin-1 character.

Disadvantages:
     -- the table covers only Latin-1 characters (French, Spanish,
Italian, German -- but not Greek, Russian, Czech, Romanian,...);
     -- the characters will look OK in the final PDF file, but in the
Notepad file *itself* you will see, for every desired accented character,
a weird-looking pair of symbols;
     -- this is a slow way to insert utf-8 characters, so it would be
suitable only if you need to insert just a *few* utf-8 characters here and
there.

I won't attach the conversion table to this message, as I think the list
administrators don't want big attachments, and I think there is nearly
zero interest in this problem anyway, as almost all other users are using
utf-8-capable text editors.

-- Tom



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Mats Bengtsson-4
In reply to this post by seng_liang


liang seng wrote:

> Hi, do you mean that on Windows XP, the word editors (like Notepad)
> are able to save text files in utf-8 code?

Exactly!

> (Since I don't have WinXP, I don't know if that is possible) I may
> have to borrow a colleague's computer with Win XP to continue my work.

As I have already pointed out, there are lots of other text editors
available
(for free), for example jEdit or Emacs, that can do the same trix and should
work also on Win98.

  /Mats


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

seng_liang
In reply to this post by stk
Hi, I would like to thank you for providing the workaround. If you don't
mind, can I ask what code or language is this workaround based on? (Like why
does one need to input two pairs of number combinations to obtain a symbol)
This will do well for me. Since I only need the symbol (più) twice for the
entire work.
Thanks again.




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

vanDongen/Gilcher
In reply to this post by stk
On Wednesday 04 January 2006 08:59, [hidden email] wrote:
> Notepad file *itself* you will see, for every desired accented character,
> a weird-looking pair of symbols;
>      -- this is a slow way to insert utf-8 characters, so it would be
> suitable only if you need to insert just a *few* utf-8 characters here and
> there

One way around that is to give each symbol a ascii name like grave or whatever
is meaningful to you. Then you just insert \your-name-here when you want that
symbol.


G


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
stk
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

stk
In reply to this post by seng_liang
>>      -- this is a slow way to insert utf-8 characters, so it would be
>> suitable only if you need to insert just a *few* utf-8 characters here
>> and there

> One way around that is to give each symbol an ascii name like grave or
> whatever is meaningful to you. Then you just insert \your-name-here
> when you want that symbol.

The problem I've had with that is that when I define

     eaigu = "<the utf-8 double byte for é>"

and then (later) say

     \markup "sym" \eaigu "trique"

what I get in the PDF file is

     sym é trique

because Lilypond inserts a space between any two markup components.

-- Tom



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
stk
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

stk
In reply to this post by seng_liang
> . . . If you don't mind, can I ask what code or language is this
> workaround based on? (Like why does one need to input two pairs of
> number combinations to obtain a symbol)

This is based on Unicode, but that doesn't really answer your question, as
Unicode is nothing but a catalogue of thousands of symbols, with each
symbol assigned a "Unicode number", which is just the catalogue-number of
the symbol.

Starting from a symbol's Unicode number, one can use an "encoding
algorithm" to produce a sequence of bytes that represents the symbol in a
real text file.  The problem is that, historically, there have been
invented several *different* encoding algorithms, and you have to know
which encoding algorithm you are using.  The two currently dominant
encoding algorithms are called UTF-16 and UTF-8.  Lilypond uses UTF-8.

(To some extent, Microsoft products use "Unicode", but they use UTF-16.
At least that is the case in the old Microsoft software I use, but my
guess is that Microsoft will stick with UTF-16, because if it switched
to UTF-8, then that would invalidate a huge existing repository of Visual
Basic programs.)

A UTF-8 character takes up either 1 or 2 or 3 or 4 or 5 or 6 bytes.
That fact alone will tell you that understanding UTF-8 is not easy.
If you really want to know the story, I recommend the following two Web
sites for starters:

http://www.tenminutetutor.com
On this site, the "Articles" box on the left of the page contains 9 links.
Click on and read the following 3:
   Unicode
   UTF-8
   UTF-16

http://en.wikipedia.org/wiki/UTF-8
This gives more information on UTF-8 and also presents an illuminating
comparison of UTF-8 to UTF-16.

-- Tom



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Gilles Sadowski
In reply to this post by stk
Hello.

>
> The problem I've had with that is that when I define
>
>      eaigu = "<the utf-8 double byte for é>"
>
> and then (later) say
>
>      \markup "sym" \eaigu "trique"
>
> what I get in the PDF file is
>
>      sym é trique
>
> because Lilypond inserts a space between any two markup components.
>

I noticed that too, and I'd tend to consider this as a bug.

And there is also the "reverse" behaviour:  Blank spaces at the
beginning or end of double-quoted strings are trimmed.  This was
reported in

  http://lists.gnu.org/archive/html/lilypond-user/2005-11/msg00277.html

but I didn't get any reply to confirm the bug.

Best,
Gilles


_______________________________________________
bug-lilypond mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/bug-lilypond
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Kurt Starsinic
In reply to this post by fiëé visuëlle
On 1/2/06, fiëé visuëlle <[hidden email]> wrote:

>
> Am 2006-01-02 um 12:43 schrieb liang seng:
>
> > Hi, I'm using Lilypond 2.7.x series for Windows 98 and I would like
> > to know how can we input special characters into Lilypond using
> > standard word editors like Notepad? I would like to put the word
> > "piu forte" in a text markup, but with a backslash on top of the u
> > in "piu". I tried using Alt+151 (the symbol ù) to enter that
> > character but it was not shown in the pdf output. Is there a way to
> > do this?
>
> This is a FAQ.
> You need to use an editor that is able to handle UTF-8 encoding
> (preferably without Byte Order Mark).

    Could you please clarify this point?  Byte Order Mark is only
applicable to UTF-16.  There's no such thing as an editor that puts a
Byte Order Mark in UTF-8.

    - Kurt


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Werner LEMBERG

> Byte Order Mark is only applicable to UTF-16.  There's no such thing
> as an editor that puts a Byte Order Mark in UTF-8.

This is not correct.  UTF-8 can also start with BOM.  The same is true
for UTF-32.


    Werner


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
stk
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

stk
In reply to this post by seng_liang

With the word-space override you suggest (below), that means that your
comment of a few weeks ago that it  _might_  be desirable to redefine
   \char #<unicode-number>
to produce a utf-8 byte string is true:  this would in fact be useful for
people who need, infrequently, to insert various odd special characters in
their Lilypond text, such as an em-dash, a capital Greek delta, or a
1/2-sign, or who need to print titles in languages, such as Portuguese or
Romanian, that have, in addition to the usual panoply of European
characters, just a few oddball characters.  Even for a text editor that
can  _save_  in utf-8,  _inputting_  the required character directly
presumably requires a character map, and at this point I don't know that
any really extensive character maps exist.

I realize that implementing a new  \char  is not trivial, since the utf-8
coding algorithm is such a mess.

-- Tom

On Thu, 5 Jan 2006, Han-Wen Nienhuys wrote:

> [hidden email] wrote:
> > The problem I've had with that is that when I define
> >
> >      eaigu = "<the utf-8 double byte for é>"
> >
> > and then (later) say
> >
> >      \markup "sym" \eaigu "trique"
> >
> > what I get in the PDF file is
> >
> >      sym é trique
> >
> > because Lilypond inserts a space between any two markup components.
>
> try
>
>    \override  #'(word-space . 0) { sym \eaigu trique }
>
> --
>   Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen




_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
stk
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

stk
In reply to this post by seng_liang
Gilles wrote:

> And . . . also . . . :  Blank spaces at the
> beginning or end of double-quoted strings are trimmed.

That's true.  To get spaces between non-space \markup items you can write
things like

     \markup { "foo" \hspace #10 "bar" }

That trick doesn't work for getting spaces at the end (I think I recall
that some people wanted such a thing for instrument names to be placed to
the left of the staff).  I don't know whether the following would work --

   \markup {"foo" \hspace #10 "<utf-8 byte codes for an invisible char>"}

-- because I haven't tried it.  By an invisible character I mean something
like a non-break space or an extra-thin or extra-wide space; I know that
such things exist in Unicode.

-- Tom



_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Gilles Sadowski
Hi.

>
> > And . . . also . . . :  Blank spaces at the
> > beginning or end of double-quoted strings are trimmed.
>
> That's true.  To get spaces between non-space \markup items you can write
> things like
>
>      \markup { "foo" \hspace #10 "bar" }
>

Yes, I knew about the "\hspace" command, but I still find it strange that
blank space is *completely* trimmed.  I agree that a typesetting program
should decide what's the best size for a blank space (and hence compress
several consecutive spaces into one, like TeX does) but not suppress them
altogether.

Best,
Gilles


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Inputting special symbols

Kurt Starsinic
In reply to this post by Werner LEMBERG
On 1/5/06, Werner LEMBERG <[hidden email]> wrote:
>
> > Byte Order Mark is only applicable to UTF-16.  There's no such thing
> > as an editor that puts a Byte Order Mark in UTF-8.
>
> This is not correct.  UTF-8 can also start with BOM.  The same is true
> for UTF-32.

    Thanks for the information.  I've been using Unicode for ten
years, and I never knew this.  Surely enough, it's an FAQ:

http://www.unicode.org/unicode/faq/utf_bom.html#25

- Kurt


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
12