Print Page | Close Window

List characters in a subset font

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3570
Printed Date: 04 May 24 at 9:36AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: List characters in a subset font
Posted By: rweetch
Subject: List characters in a subset font
Date Posted: 18 May 18 at 4:06PM
Is there anyway to get a list of the characters that are included in an embedded subset font? 



Replies:
Posted By: kevindebenu
Date Posted: 23 May 18 at 2:19PM
There isn't an existing QPL function to give the result directly.

It should be possible to loop through all the characters 0x0000 to 0xFFFF and use QP.GetTextWidth to find the width of just that character.

If the width is zero, it can be assumed that character isn't in the subset character list.

  std::wstring CharSet = L"";
  for (int C = 0x0000; C <= 0xFFFF; C++)
  {
    if ((C % 100) == 0)
    {
      std::cout << C << std::endl;
    }
    if (QP.GetTextWidth((wchar_t)C + L"") > 0)
    {
      CharSet = CharSet + (wchar_t)C;
    }
  }


Posted By: rweetch
Date Posted: 23 May 18 at 2:48PM
Thats being added to my class Helper! well, a Delphi version anyway.

thanks. 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk