Commit Graph
7 Commits
Author SHA1 Message Date
Dale Cieslak 33c9787d10 Fixes #13526 so that BFont::Blocks properly set bitmask for Unicode blocks in a font.
ParseFcMap had several logic errors.
- fixed variable being initialized in the wrong part of the loops
- fixed problem of ANDing bit with 0x8 instead of 0x1
- changed some variable names; 'foundStartBlock' implies a boolean but
it is a block number, so it is now just 'startBlock'
- added const BITS_PER_BLOCK for magic number 32
- added short-circuit for empty full or partial blocks
- initialized variables to -1 when 0 is a valid value
- added code to handle when the end of a block is reached and a range
was started but never finished.

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #13526
2017-05-22 20:53:12 +02:00
dsizzle 9b6b158b88 Implementation of BFont::Blocks
BFont::Blocks is now implemented in ServerFont, via a call through the
app_server.  It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.

A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is
checked.

Signed-off-by: Axel Dörfler <[email protected]>
2017-05-08 22:17:53 +02:00
dsizzle 0340e4b336 CharacterMap: several fixes to char. view scroll
* Select items in the encoding list by block identifier rather than
list index (there are holes in the list)
* Scroll to the start of the list when the application starts
* Add and use IsBlockVisible to detect when we need to make a block
visible, avoiding unwanted scrollings in some cases with the previous
method of testing for only one character in the block.

Signed-off-by: Adrien Destugues <[email protected]>

Fixes some problems with previous enhancements from #3651.
2014-11-27 08:50:37 +01:00
dsizzle b8a8557aa9 CharacterMap: use dynamic font menu
* only update if font family update is detected.
* character map can now detect new fonts or removed fonts without
restarting

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #3651 part 7.
2014-11-27 08:31:18 +01:00
dsizzle d67977a5ae CharacterMap: avoid jumping window size
set explicit minimum width of character view to be a bit larger than
fCodeView so that there isn't jumping of the pane sizes when fCodeView's
contents are too long

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #3651 part 9.
2014-11-26 08:34:05 +01:00
dsizzle c3205c10d7 CharacterMap: show font family and style
Signed-off-by: Adrien Destugues <[email protected]>

Fixes #3651 item 2.
2014-11-26 08:34:04 +01:00
dsizzle 74d9b875c2 CharacterMap: select Unicode block for current character
* Scrolling the list of characters now selects the currently visible
block in the blocks list.

Signed-off-by: Adrien Destugues <[email protected]>

Fixes #3651, part 1
2014-11-25 08:30:08 +01:00