Comments (5)
The workaround is correct. But it turns out that UnicodeData.txt
can define ranges. However, its parser is not so sophisticated. Therefore, I have used DerivedBidiClass.txt
to generate bidi type lookup. Can you check against the latest commit in dev
branch and let me know if the issue is fixed?
from sheenbidi.
Yes it fixed!
btw (even exists in current master) i see some valgrind warning:
==3670== Conditional jump or move depends on uninitialised value(s)
==3670== at 0xC6CB0D: BidiChainIsSingle (BidiChain.c:55)
==3670== by 0xC6CB0D: ResolveWeakTypes (IsolatingRun.c:148)
==3670== by 0xC6CB0D: IsolatingRunResolve (IsolatingRun.c:495)
==3670== by 0xC6CB0D: ProcessRun (SBParagraph.c:510)
==3670== by 0xC6CB0D: DetermineLevels (SBParagraph.c:479)
==3670== by 0xC6CB0D: SBParagraphCreate (SBParagraph.c:577)
==3670== by 0xC6CB0D: SBAlgorithmCreateParagraph (SBAlgorithm.c:157)
workaround is memset this:
diff --git a/lib/sheenbidi/Source/SBParagraph.c b/lib/sheenbidi/Source/SBParagraph.c
index 36d562cf8..f37d0aed1 100644
--- a/lib/sheenbidi/Source/SBParagraph.c
+++ b/lib/sheenbidi/Source/SBParagraph.c
@@ -17,6 +17,7 @@
#include <SBConfig.h>
#include <stddef.h>
#include <stdlib.h>
+#include <string.h>
#include "BidiChain.h"
#include "BidiTypeLookup.h"
@@ -54,6 +55,7 @@ static ParagraphContextRef CreateParagraphContext(const SBBidiType *types, SBLev
const SBUInteger offsetTypes = offsetLinks + sizeLinks;
SBUInt8 *memory = (SBUInt8 *)malloc(sizeMemory);
+ memset(memory, 0, sizeMemory);
ParagraphContextRef context = (ParagraphContextRef)(memory + offsetContext);
BidiLink *fixedLinks = (BidiLink *)(memory + offsetLinks);
SBBidiType *fixedTypes = (SBBidiType *)(memory + offsetTypes);
Your idea?
Btw another (feature request or already possible?), i will use your library for text rendering in supertuxkart:
But for chat message seems that :english in the rightmost (like in firefox) is easier to read, is it possible to implement sheenbidi for this purpose?
(btw your library is smarter than fribidi, at least the country flag is not reversed like in fribidi!)
from sheenbidi.
Yes, coveralls is broken, that's why I have not merged it in the master
branch yet.
Please ignore the warning. The data is initialized afterwards, but it's up to you to keep the memset
.
I think the alignment issue can be fixed by passing 1
in the baseLevel
parameter of SBAlgorithmCreateParagraph()
from sheenbidi.
Closing the issue as it's fixed in v2.3
from sheenbidi.
Thank you and i can use it in next stk release!
from sheenbidi.
Related Issues (17)
- Using SheenBidi with utf8 HOT 6
- License doesn't specify copyright owner(s) HOT 3
- Support Meson HOT 5
- Unsafe for allocation failure HOT 4
- Small documentation mistake HOT 1
- Specifying a smaller suggested length results in increased paragraph length HOT 1
- Specifying a smaller suggested length results in decreased boundary length HOT 1
- SBAlgorithmGetParagraphBoundary() leaves separatorLength unset if no separators. HOT 2
- PopulateBidiChain in some situations leaves SBBidiType portion of memory uninitialized. HOT 3
- OpenType Script Tag HOT 1
- Upgrade data files to Unicode 11 HOT 1
- Appveyor CI for Visual Studio Compatibility HOT 1
- Getting script of each code unit in an array
- Default property values of unassigned code points
- extern "C" in public headers? HOT 1
- requirement: Is there a demo for utf-16? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sheenbidi.