mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-07 08:38:02 +02:00
[show_text_glyphs] Allow clusters with zero text
As Adrian points out, PDF can handle it, and it doesn't harm allowing.
This commit is contained in:
parent
686fa2600d
commit
17a5f10f53
1 changed files with 7 additions and 2 deletions
|
|
@ -3236,11 +3236,16 @@ cairo_show_text_glyphs (cairo_t *cr,
|
|||
int cluster_bytes = clusters[i].num_bytes;
|
||||
int cluster_glyphs = clusters[i].num_glyphs;
|
||||
|
||||
/* A cluster should cover at least one byte.
|
||||
if (cluster_bytes < 0 || cluster_glyphs < 0)
|
||||
goto BAD;
|
||||
|
||||
/* A cluster should cover at least one character or glyph.
|
||||
* I can't see any use for a 0,0 cluster.
|
||||
* I can't see an immediate use for a zero-text cluster
|
||||
* right now either, but they don't harm.
|
||||
* Zero-glyph clusters on the other hand are useful for
|
||||
* things like U+200C ZERO WIDTH NON-JOINER */
|
||||
if (cluster_bytes < 1 || cluster_glyphs < 0)
|
||||
if (cluster_bytes == 0 && cluster_glyphs == 0)
|
||||
goto BAD;
|
||||
|
||||
/* Since n_bytes and n_glyphs are unsigned, but the rest of
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue