PilotGaea 2D O'view
    正在準備搜尋索引...

    類別 CTextStyle

    設定文字樣式

    // 建立可以在VectorLayer2D物件使用的文字樣式物件
    let textStyle = new CTextStyle();
    textStyle.Text = "New Text";
    textStyle.ContentStyle = "Shorten";
    textStyle.Weight = "bold";
    textStyle.FillColor = "yellow"
    textStyle.Baseline = "middle";
    textStyle.StrokeColor = "rgba(0, 0, 0, 0.5)";
    textStyle.StrokeWidth = 3;
    textStyle.Rotation = 1.57;
    textStyle.Size = 12;
    索引

    屬性

    Text: string

    文字內容

    ContentStyle: "hide" | "normal" | "shorten" | "wrap"

    文字處理模式,預設 "normal"

    Align: "center" | "left" | "right" | "end" | "start"

    對齊方式,預設 "center"

    Baseline: "bottom" | "top" | "middle" | "alphabetic" | "ideographic" | "hanging"

    文字內容,預設 "middle"

    Rotation: number

    文字旋轉角度,單位弧度 (正數向順時針轉),預設 0

    Font: string

    文字字型,如 "sans-serif""Arial""Courier New""Verdana" 等,預設"sans-serif"

    Weight: "bold" | "normal"

    字體粗細,預設 "normal"

    Size: number

    文字大小 (px),預設10

    OffsetX: number

    水平平移距離 (px),正值向右,預設0

    OffsetY: number

    垂直移動距離 (px),正值向下,預設0

    FillColor: string

    文字顏色,預設 "black"

    StrokeColor: string

    文字外框顏色,預設 "black"

    StrokeWidth: number

    文字輪廓粗細,預設 0

    方法

    • 複製文字樣式屬性

      回傳 CTextStyle

      const textstyle = TextStyle.Clone();