ضبط الظلال لتأثيرات النص للشكل أو مربع النص
يمكنك ضبط الظلال لـ تأثيرات النص لأي شكل أو مربع نص. يرجى استخدام الخاصية Shape.text_body. يقدم ضبط نص الشكل ويعيد FontSetting كائنات. بعد الوصول إليها، يرجى ضبط الظلال عبر الخاصية FontSetting.text_options.shadow.preset_type. هذه الخاصية من نوع PresetShadowType الذي يحتوي على عدة قيم. بعض هذه القيم هي
- OFFSET_DIAGONAL_BOTTOM_RIGHT
- OFFSET_BOTTOM
- OFFSET_DIAGONAL_TOP_RIGHT
- INSIDE_LEFT
- INSIDE_CENTER
- المنظور القطري العلوي الأيسر
- المنظور القطري العلوي الأيمن
المقتطف التالي يوضح استخدام الخاصية FontSetting.text_options.shadow.preset_type لضبط ظلال تأثيرات النص للشكل أو مربع النص.
from aspose.cells import SaveFormat, Workbook | |
from aspose.cells.drawing import PresetShadowType | |
from aspose.pydrawing import Color | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Output directory | |
outputDir = RunExamples.Get_OutputDirectory() | |
# Create workbook object | |
wb = Workbook() | |
# Access first worksheet | |
ws = wb.worksheets[0] | |
# Add text box with these dimensions | |
tb = ws.shapes.add_text_box(2, 0, 2, 0, 100, 400) | |
# Set the text of the textbox | |
tb.text = "This text has the following settings.\n\nText Effects > Shadow > Offset Bottom" | |
# Set all the text runs shadow to preset offset bottom | |
for i in range(len(tb.text_body)): | |
tb.text_body[i].text_options.shadow.preset_type = PresetShadowType.OFFSET_BOTTOM | |
# Set the font color and size of the textbox | |
tb.font.color = Color.red | |
tb.font.size = 16 | |
# Save the output file | |
wb.save(outputDir + "outputSettingTextEffectsShadowOfShapeOrTextbox.xlsx", SaveFormat.XLSX) |