رسم نص في ميزة "الإنشاء"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اطّلِع على كيفية استخدام واجهات برمجة التطبيقات Compose API المصمّمة خصيصًا لرسم نص على لوحة. يعرض هذا
القسم الرمز لرسم خط رموز تعبيرية في مستطيل بيضاوي.
النقاط الرئيسية
- في Compose، يمكنك رسم نص على لوحة من خلال إنشاء مقياس نص و
استدعاء
drawText
، ما يؤدي إلى ظهور سلسلة القياس.
- يمكنك أيضًا تخصيص حجم النص ومحاذاته وخصائصه الأخرى.
المجموعات التي تتضمّن هذا الدليل
هذا الدليل هو جزء من مجموعات الأدلة السريعة المنظَّمة التي تتناول
أهداف تطوير Android الأوسع نطاقًا:
النص الذي يظهر للمستخدم
يشكّل النص جزءًا مركزيًا من أي واجهة مستخدم. تعرَّف على الطرق المختلفة
التي يمكنك من خلالها عرض النص في تطبيقك لتوفير تجربة
ممتعة للمستخدم.
عرض الصور
تعرَّف على أساليب استخدام مرئيات مشرقة وجذابة لمنح تطبيق Android مظهرًا وشعورًا جميلَين.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-02-06 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-02-06 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Draw text in Compose\n\n\u003cbr /\u003e\n\nSee how to use Compose APIs specifically designed to draw text on a canvas. This\nsegment shows the code to draw an emoji font in a rounded rectangle. \n\nKey points\n----------\n\n- In Compose, you can draw text on a canvas by creating a text measure and calling [`drawText`](/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextLayoutResult,androidx.compose.ui.graphics.Brush,androidx.compose.ui.geometry.Offset,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)), resulting in the measuring string.\n- You can also customize the text size, alignment, and other properties.\n\nCollections that contain this guide\n-----------------------------------\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\n### Display text\n\nText is a central piece of any UI. Find out different ways you can present text in your app to provide a delightful user experience. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-text) \n\n### Display images\n\nDiscover techniques for using bright, engaging visuals to give your Android app a beautiful look and feel. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-images) \n\nHave questions or feedback\n--------------------------\n\nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]