setSelectedFont method

bool setSelectedFont({
  1. String? family,
  2. double? size,
  3. String? cssFont,
})

Updates font family/size for selected text objects.

Implementation

bool setSelectedFont({String? family, double? size, String? cssFont}) {
  return _updateSelectedObjects((object) {
    if (object is! CanvasTextObject) return object;
    final font = cssFont ?? _fontString(object.paint.font, family, size);
    return object.copyWith(paint: object.paint.copyWith(font: font));
  }, skipLocked: true);
}