Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Regarding font collection and font manager

37 views
Skip to first unread message

Sowmyyy Reanz

unread,
Mar 11, 2025, 9:59:33 AMMar 11
to skia-discuss
Team,
We are using sk paragraph for text rendering in windows
we use skia version chrome/m128
font collection's default manager --
SkFontMgr_New_DirectWrite()
font collection's dynamic manager - SkFontMgr_New_Custom_Data(span of skdata);
While text layout() is called from paragraph builder in multi threaded environment , encountering an issue as follows

  --GridWRC.dll!skia_private::THashTable<struct skia_private::THashMap<struct skia::textlayout::FontCollection::FamilyKey,class std::vector<class sk_sp<class SkTypeface>,class std::allocator<class sk_sp<class SkTypeface> > >,struct skia::textlayout::FontCollection::FamilyKey::Hasher>::Pair,struct skia::textlayout::FontCollection::FamilyKey,struct skia_private::THashMap<struct skia::textlayout::FontCollection::FamilyKey,class std::vector<class sk_sp<class SkTypeface>,class std::allocator<class sk_sp<class SkTypeface> > >,struct skia::textlayout::FontCollection::FamilyKey::Hasher>::Pair>::resize(int) C++
  --GridWRC.dll!skia_private::THashMap<struct skia::textlayout::FontCollection::FamilyKey,class std::vector<class sk_sp<class SkTypeface>,class std::allocator<class sk_sp<class SkTypeface> > >,struct skia::textlayout::FontCollection::FamilyKey::Hasher>::set(struct skia::textlayout::FontCollection::FamilyKey,class std::vector<class sk_sp<class SkTypeface>,class std::allocator<class sk_sp<class SkTypeface> > >) C++
  --GridWRC.dll!skia::textlayout::FontCollection::findTypefaces(class std::vector<class SkString,class std::allocator<class SkString> > const &,class SkFontStyle,class std::optional<class skia::textlayout::FontArguments> const &) C++
  --GridWRC.dll!skia::textlayout::OneLineShaper::matchResolvedFonts(class skia::textlayout::TextStyle const &,class std::function<enum skia::textlayout::OneLineShaper::Resolved (class sk_sp<class SkTypeface>)> const &) C++
  --GridWRC.dll!std::shared_ptr<class skia::textlayout::Run>::operator=(class std::shared_ptr<class skia::textlayout::Run> &&) C++
  GridWRC.dll!std::vector<struct skia::textlayout::OneLineShaper::RunBlock,class std::allocator<struct skia::textlayout::OneLineShaper::RunBlock> >::_Change_array(struct skia::textlayout::OneLineShaper::RunBlock * const,unsigned __int64,unsigned __int64) C++
  --GridWRC.dll!skia::textlayout::OneLineShaper::iterateThroughFontStyles(struct skia::textlayout::SkRange<unsigned __int64>,class SkSpan<struct skia::textlayout::Block>,class std::function<void (struct skia::textlayout::Block,class skia_private::TArray<struct SkShaper::Feature,1>)> const &) C++
  --GridWRC.dll!std::vector<struct skia::textlayout::OneLineShaper::RunBlock,class std::allocator<struct skia::textlayout::OneLineShaper::RunBlock> >::_Change_array(struct skia::textlayout::OneLineShaper::RunBlock * const,unsigned __int64,unsigned __int64) C++
  --GridWRC.dll!skia::textlayout::OneLineShaper::iterateThroughShapingRegions(class std::function<float (struct skia::textlayout::SkRange<unsigned __int64>,class SkSpan<struct skia::textlayout::Block>,float &,unsigned __int64,unsigned char)> const &) C++
  --GridWRC.dll!skia::textlayout::OneLineShaper::shape(void) C++
  --GridWRC.dll!skia::textlayout::ParagraphImpl::shapeTextIntoEndlessLine(void) C++
  --GridWRC.dll!skia::textlayout::ParagraphImpl::layout(float) C++

Getting crash while finding typefaces inside fontcollection class

Does Fontcollection and font managers are thread safe internally ?
When me make mutex to layout() calls , it will affect the apps performance with delay rendering
do we need to use separate fontcollection and fontmanager for each thread?
Kindly reply, thanks in advance.

param...@gmail.com

unread,
Mar 12, 2025, 3:57:24 AMMar 12
to skia-discuss
> Does Fontcollection and font managers are thread safe internally ?

No, see also this Skia issue from 2021: https://issues.skia.org/issues/40043258
Reply all
Reply to author
Forward
0 new messages