[haiku-bugs] Re: [Haiku] #11518: Implement BFont::Blocks

  • From: "dsizzle" <trac@xxxxxxxxxxxx>
  • Date: Mon, 01 May 2017 06:37:37 -0000

#11518: Implement BFont::Blocks
--------------------------------+------------------------------------------
   Reporter:  dsizzle           |      Owner:  nobody
       Type:  enhancement       |     Status:  assigned
   Priority:  normal            |  Milestone:  R1
  Component:  Kits/Interface    |    Version:  R1/Development
  Kit                           |
 Resolution:                    |   Keywords:  bfont, blocks, font, unicode
 Blocked By:                    |   Blocking:  3651
Has a Patch:  1                 |   Platform:  All
--------------------------------+------------------------------------------

Comment (by dsizzle):

 Ok, I just added a new patch that I believe is both working, and addresses
 the previous issues. It shouldn't break binary compatibility as the
 structs are back to what they were before. So, BFont::Blocks will only
 work for existing BeOS blocks and nothing else.  I added a new API to
 BFont, called IncludesBlock(), that checks for an arbitrary unicode block,
 specified via a starting and ending codepoint.  It can't use a single
 block number because Unicode blocks aren't really numbered.

 Two caveats:
 1. Earlier in the thread it was mentioned that I shouldn't have to edit
 DefaultBuildProfiles.  It seemed like I did to get Haiku to actually build
 and run properly, but I left that change out of the patch.

 2. In testing I found that this can be extremely slow if you need to check
 for lots of blocks in a font.  It's not enough to test the start and end
 codepoints for a block because a single character can be defined in the
 middle of a block, so I check every single character in a block until a
 hit is found (in the BFont::IncludesBlock function).  For fonts with large
 character sets it takes forever to check every block.

--
Ticket URL: <https://dev.haiku-os.org/ticket/11518#comment:29>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: