خطوط الأيقونات ومشكلات إمكانية الوصول فيها
تعرّفوا إلى سبب قراءة خطوط الرموز غالباً كنص غير مفهوم
خطوط الأيقونات ومشكلات إمكانية الوصول فيها درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What an Icon Font Is
An icon font maps characters to glyphs, so a letter renders as a heart or arrow. Handy for sizing, but a minefield for screen readers.
The Garbage Character Problem
Many icon fonts hide glyphs in the private use area of Unicode. With the font off, a screen reader may read a random box or odd letter.
Fonts Can Fail to Load
If the font file blocks or fails, the fallback glyph shows instead of your icon. Now users see a stray character where a clear icon should be.
CSS Content Is Not Real Text
Icon fonts often inject glyphs via CSS pseudo-elements. That generated content is fragile and easy for assistive tech to misread.
i.icon-star::before {
content: "\e801";
}Hide Decorative Icon Glyphs
If an icon font glyph is decorative, wrap it and add aria-hidden="true" so the meaningless character never reaches the accessibility tree.
<span class="icon-star" aria-hidden="true"></span>Meaningful Glyphs Need Text
When the glyph carries meaning, pair the hidden icon with real visually hidden text so the meaning survives a font failure.
<span class="icon-warn" aria-hidden="true"></span>
<span class="sr-only">Warning</span>User Stylesheets Break Them
Some users override fonts for dyslexia or low vision. Their font replaces yours, and every icon font glyph turns into a plain letter.
Translation Tools Mangle Them
Browser translation can swap the glyph characters for other text, scrambling your icons because they are technically letters, not images.
Why SVG Wins
Inline SVG sidesteps all of this: it is a real image, survives font swaps and translation, and takes role and label cleanly.
Migrating Off Icon Fonts
Modern advice is to retire icon fonts in favor of inline SVG or SVG sprites. You gain crisp rendering and far fewer accessibility traps.
Test With the Font Disabled
Block the font in devtools and reload. If you see stray characters instead of icons, your fallbacks and labels need work.
Quick Check
You inherit a page using an icon font for a meaningful star rating. What is the safest accessibility fix?
Recap: Treat Icon Fonts With Care
Icon font glyphs are fragile text: hide decorative ones with aria-hidden, back meaningful ones with real text, and prefer SVG. 🎯
الأسئلة الشائعة
هل درس «خطوط الأيقونات ومشكلات إمكانية الوصول فيها» مجاني؟
نعم — نص درس «خطوط الأيقونات ومشكلات إمكانية الوصول فيها» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.
ماذا ستتعلم في «خطوط الأيقونات ومشكلات إمكانية الوصول فيها»؟
تعرّفوا إلى سبب قراءة خطوط الرموز غالباً كنص غير مفهوم تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟
لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «خطوط الأيقونات ومشكلات إمكانية الوصول فيها»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟
نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- SVG مضمّن: role img وعنصر title
- إخفاء الأيقونات الزخرفية باستخدام aria-hidden
- أزرار الأيقونات التي تحمل اسماً أيضاً
- خطوط الأيقونات ومشكلات إمكانية الوصول فيها