mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 00:59:16 +01:00
[vector] Approximate a couple of Porter-Duff modes
The rest need structural change.
This commit is contained in:
1 parent
1ae32fb6a7
commit
521d7b2e99
2 files changed
+11
-5
No files matched your search
@@ -1437,6 +1437,11 @@ hb_pdf_blend_mode_name (hb_paint_composite_mode_t mode)
|
||||
case HB_PAINT_COMPOSITE_MODE_HSL_SATURATION: return "Saturation";
|
||||
case HB_PAINT_COMPOSITE_MODE_HSL_COLOR: return "Color";
|
||||
case HB_PAINT_COMPOSITE_MODE_HSL_LUMINOSITY: return "Luminosity";
|
||||
/* Porter-Duff modes have no PDF blend-mode equivalent; approximate
|
||||
* the two that have a plausible color-blend analog, and let the
|
||||
* rest fall through to Normal (SRC_OVER). */
|
||||
case HB_PAINT_COMPOSITE_MODE_PLUS: return "Screen";
|
||||
case HB_PAINT_COMPOSITE_MODE_XOR: return "Difference";
|
||||
case HB_PAINT_COMPOSITE_MODE_CLEAR:
|
||||
case HB_PAINT_COMPOSITE_MODE_SRC:
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST:
|
||||
@@ -1448,9 +1453,7 @@ hb_pdf_blend_mode_name (hb_paint_composite_mode_t mode)
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST_OUT:
|
||||
case HB_PAINT_COMPOSITE_MODE_SRC_ATOP:
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST_ATOP:
|
||||
case HB_PAINT_COMPOSITE_MODE_XOR:
|
||||
case HB_PAINT_COMPOSITE_MODE_PLUS:
|
||||
default: return nullptr; /* Normal / no PDF equivalent */
|
||||
default: return nullptr; /* Normal */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,11 @@ hb_vector_svg_composite_mode_str (hb_paint_composite_mode_t mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
/* Porter-Duff modes have no SVG mix-blend-mode equivalent;
|
||||
* approximate the two that have a plausible color-blend analog,
|
||||
* and let the rest fall through to normal (SRC_OVER). */
|
||||
case HB_PAINT_COMPOSITE_MODE_PLUS: return "screen";
|
||||
case HB_PAINT_COMPOSITE_MODE_XOR: return "difference";
|
||||
case HB_PAINT_COMPOSITE_MODE_CLEAR:
|
||||
case HB_PAINT_COMPOSITE_MODE_SRC:
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST:
|
||||
@@ -86,8 +91,6 @@ hb_vector_svg_composite_mode_str (hb_paint_composite_mode_t mode)
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST_OUT:
|
||||
case HB_PAINT_COMPOSITE_MODE_SRC_ATOP:
|
||||
case HB_PAINT_COMPOSITE_MODE_DEST_ATOP:
|
||||
case HB_PAINT_COMPOSITE_MODE_XOR:
|
||||
case HB_PAINT_COMPOSITE_MODE_PLUS:
|
||||
return nullptr;
|
||||
case HB_PAINT_COMPOSITE_MODE_SRC_OVER: return "normal";
|
||||
case HB_PAINT_COMPOSITE_MODE_SCREEN: return "screen";
|
||||
|
||||
Reference in new issue
Block a user