pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eliot Kimber <ekim...@rsicms.com>
Subject Re: Determining whether character/font is bold
Date Mon, 13 May 2013 17:06:23 GMT
You would expect to see something in the font name that indicates boldness,
like "bold", "heavy", etc., but that's not 100% reliable.

Cheers,

E.

On 5/13/13 12:02 PM, "Maruan Sahyoun" <sahyoun@fileaffairs.de> wrote:

> Hi Peter,
> 
> I don't think that it's possible to say that a font is bold wo the description
> of saying so. You could compare some of the characteristics of a glyph to make
> a decision e.g. if you have similar fonts. I'm not the expert on fonts though
> so maybe others are better suited to give a trustful answer.
> 
> BR
> Maruan Sahyoun
> 
> Am 13.05.2013 um 17:04 schrieb Peter Murray-Rust <pm286@cam.ac.uk>:
> 
>> I have now upgraded to 1.8.1 and am still unable to use PDFBox to determine
>> whether the font(s) are bold. I would be very grateful indeed if someone
>> could take a few minutes to see whether this is a problem with the fonts,
>> PDFBox or my usage.
>> 
>> A typical PDF is at
>> 
>> https://bitbucket.org/petermr/svg2xml-dev/src/abefe9960a8a/src/test/resources
>> /pdfs/bmc/174.pdf
>> 
>> (there are no copyright restrictions) and typical fonts (there are several
>> more) are:
>> "AdvOTce3d9a73" which I believe to be bold
>> and
>> "AdvOT56309c18.I" which I believe to be bold and italic
>> 
>> Many thanks to anyone who can give help.
>> 
>> P.
>> 
>> 
>> 
>> 
>> On Mon, May 13, 2013 at 11:55 AM, Peter Murray-Rust <pm286@cam.ac.uk> wrote:
>> 
>>> 
>>> 
>>> 
>>> On Mon, May 13, 2013 at 11:14 AM, Maruan Sahyoun
>>> <sahyoun@fileaffairs.de>wrote:
>>> 
>>>> Hi Peter,
>>>> 
>>>> which version of PDFBox are you using? If you are still on 1.7 I'd
>>>> suggest you upgrade to 1.8.1 as there were several enhancements to TrueType
>>>> handling.
>>>> 
>>>> Thanks,
>>> Yes I was on 1.7 and I'll upgrade and report. However these fonts are so
>>> non-conformant I am only semi-optimistic. Assuming it doesn't work, is
>>> there still a way of determining bold?
>>> 
>>> P.
>>> 
>>> 
>>> 
>>>> BR
>>>> Maruan
>>>> 
>>>> Am 13.05.2013 um 10:55 schrieb Peter Murray-Rust <pm286@cam.ac.uk>:
>>>> 
>>>>> I am dealing with a number of (highly non-standard) fonts and wish to
>>>>> determine whether the font is bold (and probably other attributes). The
>>>>> fontDescriptors are sometimes missing and often return null of zero
>>>> values
>>>>> (e.g. for fontDescriptor.getFontWeight() or
>>>> fontDescriptor.isForceBold().
>>>>> Yet the font displays as bold (presumably because the boldness is
>>>> encoded
>>>>> in the glyph information).
>>>>> 
>>>>> Are there ways (I will gladly accept heuristics) for determining that
a
>>>>> font is bold when this cannot be determined from the font descriptor
of
>>>> the
>>>>> font name, which occasionally has a ".B" but often does not.
>>>>> 
>>>>> At present I simply compile a list of fonts, so any help welcomed.
>>>>> 
>>>>> 
>>>>> --
>>>>> Peter Murray-Rust
>>>>> Reader in Molecular Informatics
>>>>> Unilever Centre, Dep. Of Chemistry
>>>>> University of Cambridge
>>>>> CB2 1EW, UK
>>>>> +44-1223-763069
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Peter Murray-Rust
>>> Reader in Molecular Informatics
>>> Unilever Centre, Dep. Of Chemistry
>>> University of Cambridge
>>> CB2 1EW, UK
>>> +44-1223-763069
>>> 
>> 
>> 
>> 
>> --
>> Peter Murray-Rust
>> Reader in Molecular Informatics
>> Unilever Centre, Dep. Of Chemistry
>> University of Cambridge
>> CB2 1EW, UK
>> +44-1223-763069
> 

-- 
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/


Mime
View raw message