Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4F051200B51 for ; Mon, 1 Aug 2016 23:51:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4D886160A6C; Mon, 1 Aug 2016 21:51:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9746D160A66 for ; Mon, 1 Aug 2016 23:51:08 +0200 (CEST) Received: (qmail 56481 invoked by uid 500); 1 Aug 2016 21:51:07 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 56469 invoked by uid 99); 1 Aug 2016 21:51:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2016 21:51:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 0F18AC03BC for ; Mon, 1 Aug 2016 21:51:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.61 X-Spam-Level: X-Spam-Status: No, score=-0.61 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIM_INVALID=0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=jahewson.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id uN3gfxjkGR9n for ; Mon, 1 Aug 2016 21:51:05 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 6871B5F4EA for ; Mon, 1 Aug 2016 21:51:04 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id pp5so56333084pac.3 for ; Mon, 01 Aug 2016 14:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jahewson.com; s=google; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=pQ8rClv6kWkYBR++OmAH9Cem2ub29/1dV9sZM1ilAFA=; b=TDFneiSDAI3JQUf3lneKawd/iez7wO76qRrykrY0IZe5MnoZOpfPbT5LnMTi0IrtWA abXwH4HAzVx/FLYt7f2bxJB4o/PN6DVkX+CODZoU7VYxjV1mtOPCCRMvtXo3e1YbnVvM Amyrjq/2URj2gM8lFhCUaLY7BZw8r+kZTZqw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=pQ8rClv6kWkYBR++OmAH9Cem2ub29/1dV9sZM1ilAFA=; b=VUJC/MZ/ys1R4AlO/iZ0k2nVG214Isy4SHqDNrTUmfrZrTDLVrs9G7I9x5q2svV8wn F9MlogW9PbPtqZ9P5p6T0/4Q/YO9pkxtl1Ye1pYWFhKkoDzc1bIke9EmWiP8kZkIjyqn 1KakpEFYAfEdCe4qpVDlHw+OlpCiw2BlyZ6HZ3ciLdddMWkcnZBtnwI9b68pY3zRu9b2 8hzTK2D+hvy4O9zwZDbQ09ra/rwTqaPGKaEnlwwqLHpso5M8sT+C6sb44eXNnbffdflT 3i6QioXnYStWL7yNAerd2vdOhE41x/yB8gTgqhj14aTFivyIP3/IJrtwS5Iomr90d/fe 64Fg== X-Gm-Message-State: AEkoous9EOJbzffrnTjl/su5SxXtTzSjfqL68mYB+ZbvptA7E4ME3PMq3QLqx3bIgJtGLg== X-Received: by 10.66.127.38 with SMTP id nd6mr99963130pab.74.1470088262781; Mon, 01 Aug 2016 14:51:02 -0700 (PDT) Received: from [10.0.1.12] (c-73-202-194-89.hsd1.ca.comcast.net. [73.202.194.89]) by smtp.gmail.com with ESMTPSA id a20sm47967895pfa.27.2016.08.01.14.51.02 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Aug 2016 14:51:02 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Character widths From: John Hewson In-Reply-To: Date: Mon, 1 Aug 2016 14:51:01 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <90996F3C-E8B4-4DFD-A08F-830B0400F791@jahewson.com> To: users@pdfbox.apache.org X-Mailer: Apple Mail (2.3124) archived-at: Mon, 01 Aug 2016 21:51:09 -0000 > On 1 Aug 2016, at 14:12, Aaron Mulder wrote: >=20 > On Mon, Aug 1, 2016 at 2:23 PM, John Hewson wrote: >> That=E2=80=99s correct. getStringWidth is for use when creating new = PDFs only, and we don=E2=80=99t >> implement kerning, so the width you get will be =E2=80=9Ccorrect=E2=80=9D= with respect to the text >> in the newly created PDF. >=20 > So, I guess I don't understand this part. >=20 > My impression was that if you wrote something like "/Helvetica 12 Tf > (AVAVAV) Tj" to the PDF document, a reader displaying the document > would use the standard-14 Helvetica font to draw the string "AVAVAV" > to the screen, and because that font implements kerning for those > character combinations, the reader would display the text as more > compressed horizontally than in the absence of kerning. No, PDF is rather unusual in this respect. Any kerns have to be = specified manually in the Tj array. The idea being that the PDF renderer is a = =E2=80=9Cdumb=E2=80=9D client: e.g. "AWAY again=E2=80=9D with A-W-A kerned: [ (A) 120 (W) 120 (A) 95 (Y again) ] TJ See p251 of ISO 32000 for more details. =E2=80=94 John > So my expectation is that if you did the commands above and then drew > a box around it using the horizontal dimension provided by > getStringWidth("AVAVAV"), your box would display as slightly larger > than the visible text width due to the absence of kerning in > calculating the box size based on the text width at the time you wrote > the document, but the presence of kerning in rendering the text in the > reader. >=20 > Where am I going wrong there? >=20 > Thanks, > Aaron >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org > For additional commands, e-mail: users-help@pdfbox.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org For additional commands, e-mail: users-help@pdfbox.apache.org