From 84adefa331c4159d432d22840663c38f155cd4c1 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 20 Nov 2009 14:54:40 +0000 Subject: The R13B03 release. --- lib/gs/doc/src/gs_chapter5.xmlsrc | 69 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 lib/gs/doc/src/gs_chapter5.xmlsrc (limited to 'lib/gs/doc/src/gs_chapter5.xmlsrc') diff --git a/lib/gs/doc/src/gs_chapter5.xmlsrc b/lib/gs/doc/src/gs_chapter5.xmlsrc new file mode 100644 index 0000000000..fb60272598 --- /dev/null +++ b/lib/gs/doc/src/gs_chapter5.xmlsrc @@ -0,0 +1,69 @@ + + + + +
+ + 20002009 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + Fonts + + + + + gs_chapter5.xml +
+ +
+ The Font Model +

Text related objects can be handled with the font option . A is represented as a two or three tuple:

+ + + + +

Examples of fonts are: , , , .

+

The most important requirement with the font model is to ensure that there is always a "best possible" font present. For example, if an application tries to use the font on a computer system which does not have this font available, the font model automatically substitutes .

+

Note that GS requires that the following fonts are available if using an X-server display:

+ + fixed + -*-courier-* + -*-times-* + -*-helvetica-* + -*-symbol-* + "-*-new century schoolbook-" + -*-screen-* + +

To find out which font is actually chosen by the , use the option . For example, the following situation might occur:

+
 G=gs:start().
+{1,<0.20.0>}
+2>gs:read(G,{choose_font,{times,38}}).
+{times,[],38}
+3> gs:read(G,{choose_font,{screen,italic,6}}). 
+{courier,italic,6}
+4> 
+    ]]>
+

When programming with fonts, it is often necessary to find the size of a string which uses a specific font. returns the width and height of any string and any font. The following example illustrates its usage:

+ + + Font Examples + + +
+
+ -- cgit v1.2.3