merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

I want to use characters from the Wingdings font that I have on my PC using chr(n) where n is the position.
These include numbers that are in positions 129 to 150. I can see these correctly in Word.
However, only the numbers in positions 129, 141, 143 and 145 are shown correctly in Perl.
The is demonstrated in the Perl code below.
(More can be seen in the font viewer that I posted in Cool Uses for Perl earlier this week)
(Curiously there are similar numeric characters in different positions in Wingdings2 that are shown correctly so I may use this font.)
Does any wiser Monk know how I can see the missing characters in the Wingdings font?
use Tk; use strict; my (%char_num, $jc, $jc_mod, %wg, %wg_res, $jrow, $jcol, $cou, $wing_s +tr, $wing_num); my ($size, $weight, $slant, $underline, $overstrike); my $mw = MainWindow->new(-title => 'wingdings Test'); my $f = $mw->Frame->grid(-row => 0, -column => 0); my $family = 'Wingdings'; $size = 18; $jrow = 0; $jcol = 0; $wing_str = ''; $wing_num = ''; for ($jc = 129; $jc <= 150; $jc ++) { $wing_str .= chr($jc) . ' '; $wing_num .= $jc . ' '; } $f->Label(-text => $wing_num, -justify => 'center', -bg => + 'white', -font => [-size => 15])->grid(-row => $jrow, -column => $jc +ol, -padx => 1); $wg{Label}= $f->Label(-text => $wing_str, -justify => 'center', -bg => + 'white')->grid(-row => $jrow+1, -column => $jcol, -padx => 1); $wg{Entry} = $f->Entry(-textvariable => $wing_str, -width =>35, -justi +fy => 'center')->grid(-row => $jrow + 2, -column => $jcol); &apply_font; MainLoop; sub apply_font { my $jwg; foreach $jwg (sort {$a <=> $b} keys %wg) { $wg{$jwg}->configure(-font => [-family => $family, -size => $size, ], ); } }

Replies are listed 'Best First'.
Re: Wingdings viewing problem in Tk application
by Anonymous Monk on Jul 13, 2011 at 12:01 UTC
    You can't, its a bug in Tk
      Thanks - at least there is an explanation although it is one I would prefer not to hear of!
Re: Wingdings viewing problem in Tk application
by Anonymous Monk on Jul 13, 2011 at 18:26 UTC
    Direct use of the Wingdings font is often a source of problems. Have you considered using the equivalent Unicode characters instead? I believe they are U+24EA, U+2460 through U+2469, U+24FF, and U+2776 through U+277F.

    TJD

      Thanks. No I had not since I did not realise that was possible.
      I will give it a try.