MCPcopy
hub / github.com/apache/echarts / getFont

Function getFont

src/label/labelStyle.ts:687–699  ·  view source on GitHub ↗
(
    opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>,
    ecModel: GlobalModel
)

Source from the content-addressed store, hash-verified

685}
686
687export function getFont(
688 opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>,
689 ecModel: GlobalModel
690) {
691 const gTextStyleModel = ecModel && ecModel.getModel('textStyle');
692 return trim([
693 // FIXME in node-canvas fontWeight is before fontStyle
694 opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',
695 opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',
696 (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',
697 opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'
698 ].join(' '));
699}
700
701export const labelInner = makeInner<{
702 /**

Callers 2

createIconPathsMethod · 0.90
getFontMethod · 0.90

Calls 3

trimFunction · 0.85
getShallowMethod · 0.80
getModelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…