changed some docs about font substitution
authorAndy Robinson <andy@reportlab.com>
Wed, 03 Apr 2013 22:18:16 +0100
changeset 3680 cbfd10f961b0
parent 3667 ab79820991f9
child 3681 97456f60eb12
changed some docs about font substitution
docs/userguide/ch2a_fonts.py
tests/test_pdfgen_general.py
--- a/docs/userguide/ch2a_fonts.py	Sun Mar 24 07:42:19 2013 +0000
+++ b/docs/userguide/ch2a_fonts.py	Wed Apr 03 22:18:16 2013 +0100
@@ -85,19 +85,22 @@
 """)
 
 
-heading2("Changing the built-in fonts output encoding")
+heading2("Automatic output font substitution")
 
 disc("""
 There are still a number of places in the code, including the rl_config
-defaultEncoding parameter, and arguments passed to various Font constructors.
-These generally relate to the OUTPUT encoding used when we write data in the font
-file. This affects which characters are actually available in the font if
-you are using Type 1 fonts, since only 256 glyphs can be available at
-one time. Unless you have a very specific need for
-MacRoman or MacExpert encoding characters, we advise you to ignore
-this.  By default the standard fonts (Helvetica, Courier, Times Roman)
-will offer the glyphs available in Latin-1.  If you try to print a non-Latin-1
-character using the built-in Helvetica, you'll see a rectangle or blob.
+defaultEncoding parameter, and arguments passed to various Font constructors,
+which refer to encodings.  These were useful in the past when people needed to
+use glyphs in the Symbol and ZapfDingbats fonts which are supported by PDF
+viewing devices.
+
+By default the standard fonts (Helvetica, Courier, Times Roman)
+will offer the glyphs available in Latin-1.  However, if our engine detects
+a character not in the font, it will attempt to switch to Symbol or ZapfDingbats to
+display these.   For example, if you include the Unicode character for a pair of 
+right-facing scissors, \\u2702, in a call to ^drawString^, you should see them (there is
+an example in ^test_pdfgen_general.py/pdf^).  It is not
+necessary to switch fonts in your code.
 
 """)
 
--- a/tests/test_pdfgen_general.py	Sun Mar 24 07:42:19 2013 +0000
+++ b/tests/test_pdfgen_general.py	Wed Apr 03 22:18:16 2013 +0100
@@ -204,7 +204,7 @@
 
     #quickie encoding test: when canvas encoding not set,
     #the following should do (tm), (r) and (c)
-    msg_uni = u'copyright\u00A9 trademark\u2122 registered\u00AE ReportLab in unicode!'
+    msg_uni = u'copyright\u00A9 trademark\u2122 registered\u00AE scissors\u2702: ReportLab in unicode!'
     msg_utf8 = msg_uni.replace('unicode','utf8').encode('utf8')
     c.drawString(100, 100, msg_uni)
     c.drawString(100, 80, msg_utf8)