MLightCAD
    Preparing search index...
    • Composable for the Text Style dialog (STYLE / ST command).

      Manages the text style list, current drawing text style, reactive edit form, font option derivation, and CRUD operations against textStyleTable.

      Parameters

      Returns {
          addStyle: (name: string) => boolean;
          bigFontOptions: ComputedRef<FontOption[]>;
          bigFontSupported: ComputedRef<boolean>;
          canDelete: ComputedRef<boolean>;
          canSetCurrent: ComputedRef<boolean>;
          currentStyleName: Ref<string, string>;
          deleteSelectedStyle: () => boolean;
          fontInfos: Ref<
              { file: string; name: string[]; type: "shx"
              | "mesh"; url: string }[],

                  | AcDbFontInfo[]
                  | { file: string; name: string[]; type: "shx"
                  | "mesh"; url: string }[],
          >;
          fontOptions: ComputedRef<FontOption[]>;
          fontStyleEnabled: ComputedRef<boolean>;
          fontStyleOptions: ComputedRef<string[]>;
          form: {
              backwards: boolean;
              bigFont: string;
              font: string;
              fontStyle: string;
              obliqueAngle: number;
              textHeight: number;
              upsideDown: boolean;
              useBigFont: boolean;
              vertical: boolean;
              widthFactor: number;
          };
          handleFontChange: (font: string) => void;
          handleFontStyleChange: (style: string) => void;
          isValidNewTextStyleName: (name: string) => boolean;
          openDialog: () => void;
          previewStyle: ComputedRef<Record<string, string>>;
          revertForm: () => void;
          saveSelectedStyle: () => boolean;
          selectedName: Ref<string, string>;
          selectStyle: (name: string) => void;
          setCurrentStyle: () => boolean;
          styleNames: Ref<string[], string[]>;
          TEXT_STYLE_PREVIEW: string;
      }

      Reactive state, computed UI helpers, and mutation handlers for the dialog.

      • addStyle: (name: string) => boolean

        Creates a new text style with the given name.

      • bigFontOptions: ComputedRef<FontOption[]>

        Big-font dropdown options (SHX only).

      • bigFontSupported: ComputedRef<boolean>

        Whether big-font controls are enabled.

      • canDelete: ComputedRef<boolean>

        Whether the selected style may be deleted.

      • canSetCurrent: ComputedRef<boolean>

        Whether "Set Current" is enabled.

      • currentStyleName: Ref<string, string>

        Name of the drawing's current TEXTSTYLE.

      • deleteSelectedStyle: () => boolean

        Deletes the selected text style.

      • fontInfos: Ref<
            { file: string; name: string[]; type: "shx"
            | "mesh"; url: string }[],

                | AcDbFontInfo[]
                | { file: string; name: string[]; type: "shx"
                | "mesh"; url: string }[],
        >

        Available fonts from the editor.

      • fontOptions: ComputedRef<FontOption[]>

        Primary font dropdown options.

      • fontStyleEnabled: ComputedRef<boolean>

        Whether the mesh font-style sub-selector is visible.

      • fontStyleOptions: ComputedRef<string[]>

        Mesh font face names for the selected font.

      • form: {
            backwards: boolean;
            bigFont: string;
            font: string;
            fontStyle: string;
            obliqueAngle: number;
            textHeight: number;
            upsideDown: boolean;
            useBigFont: boolean;
            vertical: boolean;
            widthFactor: number;
        }

        Reactive form bound to the selected style's properties.

        • backwards: boolean

          Mirror text backwards / right-to-left (text generation flag bit 1).

        • bigFont: string

          Big font file name when useBigFont is true (bigFontFileName).

        • font: string

          Primary font file name or mesh font identifier (fileName / textStyle.font).

        • fontStyle: string

          Selected mesh font variant; equals font for SHX fonts.

        • obliqueAngle: number

          Oblique angle in degrees (obliquingAngle).

        • textHeight: number

          Default text height for new text entities (textSize).

        • upsideDown: boolean

          Mirror text upside down (text generation flag bit 2; ignored when vertical is true).

        • useBigFont: boolean

          Whether a companion SHX big font is enabled for double-byte character support.

        • vertical: boolean

          Stack characters vertically (isVertical).

        • widthFactor: number

          Horizontal scale factor (xScale); minimum clamped to 0.01.

      • handleFontChange: (font: string) => void

        Handles primary font selection changes.

      • handleFontStyleChange: (style: string) => void

        Handles mesh font face selection changes.

      • isValidNewTextStyleName: (name: string) => boolean

        Validates a proposed new style name against current drawing styles.

      • openDialog: () => void

        Initializes state when the dialog opens.

      • previewStyle: ComputedRef<Record<string, string>>

        Inline CSS for the style preview line.

      • revertForm: () => void

        Reloads the form from the database, discarding edits.

      • saveSelectedStyle: () => boolean

        Saves form edits to the selected style record.

      • selectedName: Ref<string, string>

        Name of the style selected in the dialog list.

      • selectStyle: (name: string) => void

        Selects a style and loads it into the form.

      • setCurrentStyle: () => boolean

        Sets the selected style as the drawing TEXTSTYLE.

      • styleNames: Ref<string[], string[]>

        All text style names in the active drawing.

      • TEXT_STYLE_PREVIEW: string

        Preview sample string constant for the dialog.