PDFium Delphi Component Docs

หน่วย FPdfTextShaping

Unit: FPdfTextShaping
จัดรูปข้อความ Unicode สองทิศทางเป็น visual glyph run สำหรับ TPdf.AddShapedText พร้อมขีดจำกัดขนาดอินพุต-เอาต์พุตและคลาสฐาน shaper ที่ขยายได้

Workflow

APIPurpose
ShapePdfText(Text, FontName, FontSize, Direction, out Shaped)จัดรูปข้อความด้วย implementation Uniscribe ของ Windows ที่มีในตัวและขีดจำกัด resource เริ่มต้น
TPdfTextShaper.Shapeสัญญาการจัดรูปแบบ abstract สำหรับเอนจินกำหนดเอง ที่คืน glyph identifier, cluster, visual run, advance และข้อมูลฟอนต์ที่เลือก
TPdfUniscribeTextShaper.Shapeใช้ usp10.dll แบ่งช่วงข้อความ จัดรูป วางตำแหน่ง และเรียงลำดับการมองเห็นของ text run ใหม่
TPdfTextShapingOptions.Defaultคืนทิศทางแบบอัตโนมัติ พร้อมขีดจำกัด 1,000,000 อักขระ, 2,000,000 glyph และ 100,000 run
ConfigureTextShaper(Shaper)ติดตั้ง backend จัดรูปที่หน่วยใช้ โดยแทนที่ตัวในตัวไปจนจบโปรเซส; หน่วยจะเป็นเจ้าของอินสแตนซ์นั้น
ClearTextShaperถอด backend ที่ติดตั้งไว้แล้วกลับไปใช้ค่า default ของแพลตฟอร์ม
ActiveTextShaperbackend ที่ใช้งานอยู่ หรือ nil เมื่อแพลตฟอร์มนี้ไม่มี shaper
ActiveTextShaperNameชื่อที่ backend ที่ active รายงาน ใช้เก็บ log และแยกการ deploy แต่ละแบบ

Public types

TypeDescription
EPdfTextShapingErrorexception ที่เกิดจากอินพุตไม่ถูกต้อง การละเมิดขีดจำกัด resource, ความล้มเหลวของข้อมูลฟอนต์ หรือ error ของเอนจินจัดรูป
TPdfTextDirectionptdAuto, ptdLeftToRight หรือ ptdRightToLeft
TPdfShapedGlyphglyph หนึ่งตัวพร้อม GlyphID, Advance, OffsetX, OffsetY, ClusterStart และ ClusterLength
TPdfShapedGlyphsอาร์เรย์แบบ dynamic ของเรกคอร์ด TPdfShapedGlyph
TPdfShapedRunvisual run หนึ่งชิ้นพร้อม TextStart, TextLength, VisualX, Width, BidiLevel, IsRightToLeft และ Glyphs
TPdfShapedRunsอาร์เรย์แบบ dynamic ของเรกคอร์ด TPdfShapedRun เรียงตามลำดับการมองเห็น
TPdfShapedTextข้อความต้นทาง Text, FontName กับ FontSize ที่เลือก, FontData ที่ฝัง, Runs ที่จัดรูปแล้ว, Width รวม, GlyphCount และ LogicalCharacterCount
TPdfTextShapingOptionsขีดจำกัด resource Direction, MaxCharacters, MaxGlyphs และ MaxRuns
TPdfTextShaperคลาสฐาน abstract สำหรับ implementation จัดรูปที่ผู้เรียกจัดหา
TPdfUniscribeTextShaperimplementation ของ Windows ที่มีในตัวสำหรับ TPdfTextShaper

Remarks

Example

var
  Shaped: TPdfShapedText;
  MeasuredWidth: Single;
begin
  if ShapePdfText(Text, 'Segoe UI', 12, ptdAuto, Shaped) then
    MeasuredWidth := Shaped.Width;
end;

See Also

TPdf.AddShapedText