~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychDemos/DrawHighQualityUnicodeTextDemo.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
% DrawHighQualityUnicodeTextDemo
2
2
%
3
3
% This demo shows how to draw high-quality, anti-aliased text, and some
4
 
% japanese text encoded in Unicode on Apple MacOS/X and Microsoft Windows.
5
 
% GNU/Linux is not yet supported for anti-aliased and unicode text rendering.
 
4
% japanese text encoded in Unicode.
6
5
%
7
6
% MacOS/X has text fonts with support for japanese characters preinstalled,
8
7
% so this should just work out of the box. Have a look at the code of the
25
24
% After that, text drawing seems to "just work" with our "Courier New"
26
25
% font. If you don't install the font pack, you'll just see funny little
27
26
% squares instead of nice japanese characters...
 
27
%
 
28
% On MacOS/X you have the choice between three different text
 
29
% rendering/layouting methods, as selectable by the Screen preference
 
30
% setting 'TextRenderer': The default is 1, which selects Apple's ATSU text
 
31
% renderer. A setting of 0 would also select ATSU but would use a different
 
32
% method for layout of text. Each method has its own weaknesses in that it
 
33
% will have trouble drawing text in some special fonts correctly, so you
 
34
% may have to choose the method based on the font to get best results.
 
35
% Typical standard fonts are handled correctly by both methods. A setting
 
36
% of 2 will use the Linux text rendering plugin (see "help DrawTextPlugin")
 
37
% which in our experience handles all fonts well and is of superior
 
38
% performance to the OSX ATSU renderer. However, given that historically
 
39
% ATSU was used on OSX for many years and each layout and rendering method
 
40
% will give slightly different text appearance, for reason of consistency
 
41
% we leave the default setting for OSX on 1, instead of using the superior
 
42
% setting 2.
 
43
%
28
44
 
29
45
% 11/26/07  mk      Wrote it. Derived from Allens DrawSomeTextDemo.
30
46