Simple Text Setting Calculations for PostScript Language Drivers

Similar documents
Level 2 Compatibility: The setscreen and currentscreen Operators

Using save Outside the Server Loop

The StemSnap Hint Operator for Type 1 Font Programs

Supporting Level 2 Functionality

Acrobat Widths-Only CIDFont Tutorial ADOBE SYSTEMS INCORPORATED

Font Switching Optimizations

CID-Keyed Font Technology Overview

Supporting Data Compression in PostScript Level 2 and the filter Operator

Emulation of the setstrokeadjust Operator

The Adobe-CNS1-6 Character Collection

Printer Systems-Based Separations

Adobe Serial and Parallel Communications Protocols Specification

Recording Output Intentions for Color Critical Workflows ADOBE SYSTEMS INCORPORATED

Supporting Device Features

Emulation of the execform Operator

Timing Techniques. Adobe Developer Support. Technical Note # March Adobe Systems Incorporated

FontLab. TECHNICAL NOTE #002 (Mac) Keyboard shortcuts. Copyright 2001 FontLab Ltd. THE DIGITAL TYPE DESIGN TOOLKIT

Photofont Start 2.0. for Macintosh and Windows. User Manual

Improving Image Performance by Using Color Lookup Tables

Adobe Acrobat Reader Help

HP DesignJet 3500CP Printing Guide for Windows

Tuning CUDA Applications for Fermi. Version 1.2

SUPPORT MATRIX. HYCU OMi Management Pack for Citrix

Organize and Deliver Digital Assets Using Adobe Experience Manager v6.x Student Workbook

SUPPORT MATRIX. Comtrade OMi Management Pack for Citrix

x10data Smart Client 6.5 for Windows Mobile Installation Guide

HYCU SCOM Management Pack for F5 BIG-IP

CHECK PROCESSING. A Select Product of Cougar Mountain Software

SDK White Paper. Vertex Lighting Achieving fast lighting results

AvePoint SearchAll for Microsoft Dynamics CRM. Release Notes

Utility Bus Split (v1.00a)

Utility Reduced Logic (v1.00a)

Conversion SDK v11 32-bit and 64-bit

HP SmartStream Designer 22 For Adobe Illustrator

How to Use These Tutorials Adobe Acrobat Tour Creating a Presentation Capturing and Cataloging About the Acrobat Tutorials

IronPort Plug-in for Outlook VERSION 1.5 RELEASE NOTES

PostScript Language File Transmission (PSFT) Specification. Adobe Developer Support. 02 April Adobe Systems Incorporated

Intel Setup and Configuration Service. (Lightweight)

Adobe. Type Manager 4.1. User Guide

x10data Smart Client 7.0 for Windows Mobile Installation Guide

AccelDSP Synthesis Tool

IBM Content Analytics with Enterprise Search Version 3.0. Expanding queries and influencing how documents are ranked in the results

Font Information Files for Bitstream Soft Fonts

AvePoint Privacy Impact Assessment 1 Release Notes

Microsoft Dynamics GP. Purchase Vouchers

Design Insights Enhanced Cue Functionality

Display PostScript System

GemBuilder for Java Release Notes

NVIDIA nforce 790i SLI Chipsets

Microsoft Dynamics GP. Inventory Kardex

Technical Report. Anisotropic Lighting using HLSL

IBM InfoSphere Data Replication s Change Data Capture (CDC) for DB2 LUW databases (Version ) Performance Evaluation and Analysis

Encoder Core. API Specification. Revision: SOC Technologies Inc.

User Guide. TexturePerformancePBO Demo

SDK White Paper. HLSL Blood Shader Gravity Maps

LED-Matrix Display. LED2 Matrix Display. User Manual. Version 2.0

Adobe FrameMaker Template Series

Software Installation Guide

Quick Reference Manual

WinTen² Custom Report Writer

GPU LIBRARY ADVISOR. DA _v8.0 September Application Note

HP SmartStream Designer 21 For Adobe Illustrator

Sage Financial Reporter User's Guide

Upgrading BankLink Books

ScriptServer Printing System Release Notes

IBM StoredIQ Platform Version Overview Guide GC

User s Manual for H4S & NetPoint 2.2

SUNDE. User s Manual for NetPoint2.2 & H4S USER MANUAL FOR NETPOINT2.2 AND H4S 1

FFT/IFFT Block Floating Point Scaling

SW MAPS TEMPLATE BUILDER. User s Manual

NVIDIA GPU CLOUD IMAGE FOR GOOGLE CLOUD PLATFORM

DIGITAL COLOR PRESS DIGITAL ENVELOPE PRESS DIGITAL PRODUCTION PRESS. Utilities Guide

Adobe Font Metrics File Format Specification

XCM8800 PSU Cover. Installation Guide. 350 East Plumeria Drive San Jose, CA USA. May v1.0

PostScript Japanese Font File Organization Overview

Text. Text metrics. There are some important metrics that we must consider when working with text. Figure 4-1 shows the basics.

VCU108 Built In Test July 2015

Adobe Acrobat Weblink Plug-in

Bill Designer for Shoper 9

Report Manager. Release Notes. Version 5.0 HF1

TippingPoint Intrusion Prevention System Release Notes

AvePoint Cloud Backup. Release Notes

TransType. Mac, PC, PostScript, TrueType basic font converter

Application Note: NTP server access via SiteManag-

Intel 82580EB/82580DB GbE Controller Feature Software Support. LAN Access Division (LAD)

NVIDIA GPU CLOUD IMAGE FOR MICROSOFT AZURE

Enthusiast System Architecture Certification Feature Requirements

What s New in Adobe InDesign CS4 Products SDK

Creating Your User Account. LANDESK Self-Service Support Portal

Sage HRMS Sage 100 Advanced ERP G/L Link User Guide. April 2014

VTR-S1000. Quick-Start Guide. - Decoder Kit. Evaluation and Product Development Platform. Revision SOC Technologies Inc.

Quick Start Guide. SP Usage Simulator Tool. Evaluating the Performance of SharePoint Environment Using the New DocAve SP Test Environment Creator

Trademarks. Copyright This manual is Copyrighted 2006 by Xanté Corporation. All Rights Reserved. Printed in the USA.

SDK White Paper. Matrix Palette Skinning An Example

Tisio CE Release Notes

MIF Filter. User Guide. for MIF Filter version 2.0 Windows Edition and Macintosh Edition.

Network Performance Monitor

LonScanner TM Protocol Analyzer User's Guide

ADOBE EXPERIENCE MANAGER DAM CONNECTOR FOR ADOBE DRIVE CC: TECHNICAL NOTE

GRID SOFTWARE FOR RED HAT ENTERPRISE LINUX WITH KVM VERSION /370.28

Transcription:

Simple Text Setting Calculations for PostScript Language Drivers Adobe Developer Support Technical Note #5041 31 March 1992 Adobe Systems Incorporated Adobe Developer Technologies 345 Park Avenue San Jose, CA 95110 http://partners.adobe.com/ PN LPS5041

Copyright 1987 1989, 1991 1992 by Adobe Systems Incorporated. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the publisher. Any software referred to herein is furnished under license and may only be used or copied in accordance with the terms of such license. PostScript, the PostScript logo, Adobe, and the Adobe logo are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Macintosh is a registered trademark of Apple Computer, Inc. Other brand or product names are the trademarks or registered trademarks of their respective holders. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes and noninfringement of third party rights.

Contents Simple Text Setting Calculations for PostScript Language Drivers 5 1 Introduction 5 2 Line Breaking 5 3 Line Layout Options 6 Ragged Right Text 6 Justified Text 7 Centered Text 7 Flush-Right Text 7 Appendix: Changes Since Earlier Versions 9 Index 11 iii

iv Contents (31 Mar 92)

Simple Text Setting Calculations for PostScript Language Drivers 1 Introduction Setting text with the PostScript language involves two basic operations: determining where to break a line and distributing the text appropriately once the line breaks have been established. 2 Line Breaking Line breaking involves determining the point at which no more text will fit on the current line. A text-processing system should maintain this information on the host system for two reasons: 1) a WYSIWYG application needs to have this information to properly show line breaks on the screen and 2) even if the application is not WYSIWYG, because the PostScript language is interpreted, any calculations that can be done on the host, should be, to enhance the performance of the print job. Line breaking is based on the widths of the individual characters. When using PostScript fonts, these decisions are made based on font metrics. These metrics provide the width of each character, which can be used to keep track of the overall string width of a line of text set in that font. Font metrics are distributed by Adobe Systems in the form of Adobe Font Metric (AFM) files. These files contain the width of each character in the font in units of 1/1000 of an em. The numbers are independent of point size they actually represent an idealized 1-point size. See the Adobe Font Metrics File Format Specification for more information. Font metrics can be maintained in other forms on any given host system. For example, on the Macintosh the information is available in the FOND resource for each font. The information is typically parsed from the AFM files and written into the more host-specific format. 5

The following is a calculation that will yield the correct string width of a piece of text, based on the width of the individual characters in the line (as found in the AFM files) StringWidth = Σ ((AFM widths all characters) x Point Size) 1000 The string width can be maintained as the sum of the (integer) AFM width of the characters. When the precise width is needed at the PostScript language level, the string width value can be multiplied by the point size of the text and divided by 1000. Note Floating-point calculations can be eliminated completely if the final division by 1000 is handled by relocating the decimal point in the resulting number. The width computed by this method is as accurate as computing (in the PostScript interpreter) the stringwidth of 1000-point characters, and, in fact, the widths stored in the PostScript language character descriptions themselves are exactly the same numbers as appear in the AFM files. Remember that the character descriptions are executed in a character coordinate space scaled by the FontMatrix entry in the font dictionary (the scale factor is 1000 in all Adobe fonts). 3 Line Layout Options There are several kinds of text setting that can be easily implemented once the width of the line of text is known. 3.1 Ragged Right Text Once the line of text has been constructed and line breaks are determined, it is only necessary at the PostScript language level to set the current font, the current position, and use the show operator to image the text. This will provide ragged right text LeftMargin Y moveto (Line of text) show 6 Simple Text Setting Calculations for PostScript Language Drivers (31 Mar 92)

3.2 Justified Text If you want the text justified, it is necessary to determine how much the line must be adjusted and to use the widthshow operator to modify the word spacing accordingly. The amount to pass to widthshow is computed as follows: SpaceMod = (LineWidth StringWidth) ------------------------------------------------------ Spaces In this equation, LineWidth is the desired width of the column (the fully justified width of the line of text). StringWidth is the width of the line of text as computed above, based on the AFM widths of the characters. Spaces is a count of the total number of space characters in the line of text. The value SpaceMod is used with the byte code for the space character (32) in the call to widthshow: LeftMargin Y moveto SpaceMod 0 32 (Line of text here) widthshow This will modify all occurrences of the space character by the amount given by SpaceMod. This accomplishes word spacing to achieve full justification. 3.3 Centered Text Text can be centered even more easily than justifying. The StringWidth of the text can be simply divided in half, and the current point established from the center point of the column of text. The X value passed to moveto in the PostScript language is X = CenterMargin StringWidth ----------------------- 2 In the PostScript language, the text is set simply X Y moveto (Line of text) show 3.4 Flush-Right Text Flush-right text can be obtained in much the same way as centered text: X = RightMargin StringWidth At the PostScript language level, the text is set simply X Y moveto (Line of text) show 3 Line Layout Options 7

8 Simple Text Setting Calculations for PostScript Language Drivers (31 Mar 92)

Appendix: Changes Since Earlier Versions Changes since the May 4, 1991 version Document was reformatted in the new document layout and minor editorial changes were made. Changes since the January 16, 1989 version A few layout styles were changed. The cover addresses and phone numbers were updated. 9

10 Appendix: Changes Since Earlier Versions (31 Mar 92)

Index C centered text 7 F flush-right text 7 font 5 J justified text 7 L line breaking 5 LineWidth 7 P PostScript language drivers text setting calculations 5 7 floating-point calculations 6 font metrics 5 line layout options 6 7 R ragged right text 6 S SpaceMod 7 StringWidth 7 11