MCPcopy Create free account
hub / github.com/defold/defold / FontCollectionRemoveFont

Function FontCollectionRemoveFont

engine/font/src/fontcollection.cpp:94–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94FontResult FontCollectionRemoveFont(HFontCollection coll, HFont hfont)
95{
96 for (uint32_t i = 0; i < coll->m_Fonts.Size(); ++i)
97 {
98 if (coll->m_Fonts[i] == hfont)
99 {
100 coll->m_Fonts.EraseSwap(i);
101 break;
102 }
103 }
104
105#if defined(FONT_USE_SKRIBIDI)
106 dmHashTable<skb_font_handle_t, HFont>::Iterator iter = coll->m_FontLookup.GetIterator();
107 while(iter.Next())
108 {
109 if (iter.GetValue() == hfont)
110 {
111 skb_font_collection_remove_font(coll->m_Collection, iter.GetKey());
112 coll->m_FontLookup.Erase(iter.GetKey());
113 break;
114 }
115 }
116#endif
117 return FONT_RESULT_OK;
118}
119
120TextLayoutType FontCollectionGetLayoutType(HFontCollection coll)
121{

Callers 1

ResFontRemoveFontFunction · 0.85

Calls 5

GetIteratorMethod · 0.80
SizeMethod · 0.45
NextMethod · 0.45
EraseMethod · 0.45

Tested by

no test coverage detected