permil symbol

63 views
Skip to first unread message

Sangwoo Lee

unread,
Mar 18, 2025, 5:00:28 AMMar 18
to idl-pvwave
Hi.

I tried to use permil symbol in NG window, but nothing is shown but a null string. The example code is as follows.

win = WINDOW(DIMENSIONS=[600, 400], /NO_TOOLBAR)
tx = TEXT(0.5, 0.6, '$\int\infty\forall\deg\sum\permil$', $
  ALIGNMENT=0.5, FONT_SIZE=24, /NORMAL)

Many other mathematical and greek symbols work fine but only the permil symbol doesn't work. I encountered this issue in IDL 9.1 and 9.0 WIndows version. I wonder if this is a bug or if there's any workaround.

Sangwoo

20250318_permil_symbol.png

Andrew Cool

unread,
Mar 18, 2025, 8:05:17 PMMar 18
to idl-pvwave

IDL> print,string(0137b)


which works as far back as IDL v6.2, and almost certainly further into the dark ages.

Ben C

unread,
Mar 19, 2025, 4:48:09 PMMar 19
to idl-pvwave
Permil seems to work fine in IDL 9.0 on Windows 11, but you may also have luck with Andrew's suggested byte-string. 

Screenshot 2025-03-19 144635.png

Sangwoo Lee

unread,
Mar 20, 2025, 2:58:59 AMMar 20
to idl-pvwave
Unfortunately, STRING(137b) doesn't give the permil symbol properly in my environment. So I tried to print all the letters from 32b to 255b as follows.

win = WINDOW(DIMENSIONS=[600, 400], /NO_TOOLBAR)
tx1 = TEXT(0.5, 0.7, STRING(BINDGEN(32)+32b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx2 = TEXT(0.5, 0.6, STRING(BINDGEN(32)+32b+32b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx3 = TEXT(0.5, 0.5, STRING(BINDGEN(32)+32b+64b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx4 = TEXT(0.5, 0.4, STRING(BINDGEN(32)+32b+96b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx5 = TEXT(0.5, 0.3, STRING(BINDGEN(32)+32b+128b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx6 = TEXT(0.5, 0.2, STRING(BINDGEN(32)+32b+160b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)
tx7 = TEXT(0.5, 0.1, STRING(BINDGEN(32)+32b+192b), FONT_SIZE=20, ALIGNMENT=0.5, /NORMAL)

I tested the above code on my available environments which are IDL 9.1 for Windows 11 and IDL 9.0 for Mac OS 12.7.6. The results can be seen in the attached figures. It seems like there's no problem on English version of each OS. But this issue clearly happens on Korean version of OS. It's also weird to see different anomalies in WIndows and Mac OS. It's clear that I cannot use permil symbol in IDL on both OS. I'm not sure this issue also happens on other Asian 2-byte language OS such as Japanese or Chinese ones. Could you check more deeply on this issue?

20250319_letters_idl91_win11.png20250319_letters_idl90_macos.png
2025년 3월 20일 목요일 오전 5시 48분 9초 UTC+9에 Ben C님이 작성:

Andrew Cool

unread,
Mar 20, 2025, 8:53:44 PMMar 20
to idl-pvwave
what about:-

win = WINDOW(DIMENSIONS=[500, 500], /NO_TOOLBAR)


x= TEXT(0.5, 0.5, STRING('permil = $\permil$'), FONT_SIZE=30, ALIGNMENT=0.5, /NORMAL)

Sangwoo Lee

unread,
Mar 21, 2025, 3:36:34 AMMar 21
to idl-pvwave
Thank you for your advice, but it doesn't work for me. I using the following method for permil as an alternative.

tx = TEXT(0.5, 0.5, '37.6$\deg/$!iOO!n is abnormal', FONT_SIZE=24, ALIGNMENT=0.5, /NORMAL)

2025년 3월 21일 금요일 오전 9시 53분 44초 UTC+9에 and...@cool.id.au님이 작성:

Chris Torrence

unread,
Mar 26, 2025, 3:35:33 PMMar 26
to idl-pvwave
Hi Sangwoo,

I took a look at this, and I think it must be something to do with the language localization on your system. The Text function ends up calling "tex2idl" on the string, and that just spits out the byte value 137 (0x89) for that permil character.

So I don't think there is anything strange going on, and I don't see anyway to fix this. You might try different fonts, and see if that makes a difference. For example, on Windows you could try:
win = WINDOW(DIMENSIONS=[600, 400], /NO_TOOLBAR)
tx = TEXT(0.5, 0.6, '$\int\infty\forall\deg\sum\permil$', $
  ALIGNMENT=0.5, FONT_SIZE=24, /NORMAL)
tx.font_name = 'Arial'

Hope this helps.
Cheers,
Chris
NV5 Geospatial Software

Andrew Cool

unread,
Mar 26, 2025, 7:58:50 PMMar 26
to idl-pvwave
Which gets back to my suggestion to install a Korean language Unicode font...

Andrew

Sangwoo Lee

unread,
Mar 27, 2025, 3:54:11 AMMar 27
to idl-pvwave
Hi Chris,

Your mentioning "tex2idl" leaded me to an idea of using \U operator, which is successful. '$\U(2030)$' gives me the permil symbol correctly. I guess other special characters which were not usable with an expression like '$\permil$' can be used with \U operator. Thank you so much for your advice.

tx = TEXT(0.5, 0.5, '37.6$\U(2030)$ is abnormal', FONT_SIZE=24, ALIGNMENT=0.5, /NORMAL)

Sangwoo

20250327_permil_symbol.png

2025년 3월 27일 목요일 오전 4시 35분 33초 UTC+9에 gort...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages