MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveThemeFont

Function resolveThemeFont

apps/sim/lib/pptx-renderer/renderer/text-renderer.ts:384–396  ·  view source on GitHub ↗

* Resolve theme font placeholder references like "+mj-lt" or "+mn-lt".

(typeface: string, ctx: RenderContext)

Source from the content-addressed store, hash-verified

382 * Resolve theme font placeholder references like "+mj-lt" or "+mn-lt".
383 */
384function resolveThemeFont(typeface: string, ctx: RenderContext): string {
385 if (typeface === '+mj-lt' || typeface === '+mj-ea' || typeface === '+mj-cs') {
386 const key = typeface.slice(3) as 'lt' | 'ea' | 'cs'
387 const mapping: Record<string, 'latin' | 'ea' | 'cs'> = { lt: 'latin', ea: 'ea', cs: 'cs' }
388 return ctx.theme.majorFont[mapping[key] || 'latin'] || typeface
389 }
390 if (typeface === '+mn-lt' || typeface === '+mn-ea' || typeface === '+mn-cs') {
391 const key = typeface.slice(3) as 'lt' | 'ea' | 'cs'
392 const mapping: Record<string, 'latin' | 'ea' | 'cs'> = { lt: 'latin', ea: 'ea', cs: 'cs' }
393 return ctx.theme.minorFont[mapping[key] || 'latin'] || typeface
394 }
395 return typeface
396}
397
398/**
399 * Resolve a gradient fill node into a CSS linear-gradient string.

Callers 1

mergeRunPropsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected