mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix bug 66872
This commit is contained in:
@ -134,7 +134,11 @@ JSSmart<CJSValue> CTextMeasurerEmbed::FT_Get_Glyph_Render_Params(JSSmart<CJSValu
|
||||
JSSmart<CJSValue> CTextMeasurerEmbed::FT_Get_Glyph_Render_Buffer(JSSmart<CJSValue> face, JSSmart<CJSValue> size)
|
||||
{
|
||||
void* Data = NSShaper::FT_Get_Glyph_Render_Buffer(RAW_POINTER(face));
|
||||
return CJSContext::createUint8Array((unsigned char*)Data, size->toInt32(), true);
|
||||
int nSize = size->toInt32();
|
||||
int nSizeMax = NSShaper::FT_Get_Glyph_Render_BufferSize(RAW_POINTER(face));
|
||||
if (nSize > nSizeMax)
|
||||
nSize = nSizeMax;
|
||||
return CJSContext::createUint8Array((unsigned char*)Data, nSize, true);
|
||||
}
|
||||
|
||||
JSSmart<CJSValue> CTextMeasurerEmbed::FT_Set_Transform(JSSmart<CJSValue> face, JSSmart<CJSValue> xx, JSSmart<CJSValue> yx, JSSmart<CJSValue> xy, JSSmart<CJSValue> yy)
|
||||
|
||||
@ -356,6 +356,12 @@ namespace NSShaper
|
||||
return ((FT_Face)face)->glyph->bitmap.buffer;
|
||||
}
|
||||
|
||||
int FT_Get_Glyph_Render_BufferSize(void* face)
|
||||
{
|
||||
FT_GlyphSlot slot = ((FT_Face)face)->glyph;
|
||||
return slot->bitmap.pitch * slot->bitmap.rows;
|
||||
}
|
||||
|
||||
bool FT_Get_Glyph_Render_Params(void* face, int render_mode, CExternalPointer* result)
|
||||
{
|
||||
FT_GlyphSlot slot = ((FT_Face)face)->glyph;
|
||||
|
||||
@ -70,6 +70,7 @@ namespace NSShaper
|
||||
|
||||
GRAPHICS_DECL bool FT_Get_Glyph_Render_Params(void* face, int render_mode, CExternalPointer* result);
|
||||
GRAPHICS_DECL unsigned char* FT_Get_Glyph_Render_Buffer(void* face);
|
||||
GRAPHICS_DECL int FT_Get_Glyph_Render_BufferSize(void* face);
|
||||
|
||||
GRAPHICS_DECL void FT_Glyph_Get_CBox(void* glyph, unsigned int bbox_mode, CExternalPointer* result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user