MCPcopy Create free account
hub / github.com/microsoft/SandDance / getTextWidth

Function getTextWidth

docs/app/js/sanddance-app.js:106014–106024  ·  view source on GitHub ↗
(text, mapping)

Source from the content-addressed store, hash-verified

106012 };
106013}
106014function getTextWidth(text, mapping) {
106015 var width = 0;
106016 for(var i = 0; i < text.length; i++){
106017 var character = text[i];
106018 var frameWidth = null;
106019 var frame = mapping && mapping[character];
106020 if (frame) frameWidth = frame.width;
106021 width += frameWidth;
106022 }
106023 return width;
106024}
106025function breakAll(text, maxWidth, iconMapping) {
106026 var rows = [];
106027 var rowStartCharIndex = 0;

Callers 2

breakAllFunction · 0.70
breakWordFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected