1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Unicode: Ignore punctuation when resolving implicit characters

This commit implements fix for an issue where mixed punctuation can be rendered in the wrong order.

A regression test has been added to catch this in the future.
This commit is contained in:
Oliver James 2024-05-22 15:03:51 +01:00
parent 0b60559905
commit 44a750df40
2 changed files with 10 additions and 6 deletions

View file

@ -310,6 +310,7 @@ public:
doTest ("12345_00001");
doTest ("1_3(1)");
doTest ("-12323");
doTest ("8784-43_-33");
}
};

View file

@ -387,15 +387,18 @@ private:
const auto level = (uint16_t) embeddingLevel;
const auto isEven = isOdd (level) == false;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wswitch-enum")
switch (curr.getBidiType())
if (curr.getGeneralCategory() != GeneralCategory::pc)
{
case BidiType::ltr: curr.bidiLevel = (isEven ? level : level + 1); break;
case BidiType::rtl: curr.bidiLevel = (isEven ? level + 1 : level ); break;
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wswitch-enum")
switch (curr.getBidiType())
{
case BidiType::ltr: curr.bidiLevel = (isEven ? level : level + 1); break;
case BidiType::rtl: curr.bidiLevel = (isEven ? level + 1 : level ); break;
default: break;
default: break;
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
}
}