Empower growth and innovation with the latest Mobile App insights

The same icon font looks fine in my DevTools, but on a user's Android phone it shows as a row of small boxes — is the font not loading, or are the code points wrong?

Nov 25, 2026 Read: 12

Conclusion first: when icons turn into a row of small boxes on a real device, it is usually not because the icons were drawn wrong, but because the font file was not actually loaded on the phone, or the character code points do not match the glyphs in the font. DevTools runs in a local environment, and fonts often use local paths or a development proxy, so everything looks normal; on a real device, the font either has to go through a network request — and if the domain is not added to the downloadFile valid domains, it will fail silently — or the platform's support for formats such as woff2 and eot is inconsistent. Based on common project situations in 2026, checking “font loading path” and “character encoding” as two separate issues first saves more time than repeatedly redrawing icons.

First distinguish whether the font is not loaded or the characters do not match

Both failures look like boxes, but the direction of the fix is completely opposite. When the font is not loaded, usually an entire row of icons disappears together or turns into boxes together, while other text on the page is unaffected; when characters do not match, often only individual icons have problems, or they display as another unrelated shape. Making this distinction first can save half of unnecessary changes.

  • An entire row turns into boxes or blank: suspect first that the font file did not reach the phone; the direction is path, domain, and format.
  • Only individual icons are abnormal: suspect first that the Unicode code points do not correspond to the glyphs in the font — for example, the font package was replaced but the code still uses old code points.
  • Displaying as hollow squares means missing glyphs, while displaying as question marks or garbled text means an encoding-path problem; the two should be examined separately.
  • Looking normal in DevTools is only weak evidence; it runs in a local environment and cannot represent a real device.

A handy way to judge is: temporarily convert the problematic font to base64 and write it directly into the styles, then verify once more on a real device. If the icons recover, the problem lies in the loading path; if they are still boxes, check character mapping and the font package itself. This takes only a few minutes, much faster than trying style properties one by one.

DevTools is normal but the real device is not — which parts of the path differ?

Several segments lie between DevTools and a real device: whether the font is read from the package, from a local directory, or downloaded from a network address; whether the domain of the network address is on the whitelist; whether WeChat caches the font file; and whether the font format is recognized by the webview on the target model. If any segment does not match, the symptom is the same sentence — the icons become boxes.

  • Source: a network address must be configured in downloadFile valid domains; if it is missing, loading will fail, and an error may not necessarily appear in the console.
  • Format: woff2 is small, but support in some older Android webviews is inconsistent; ttf has broader compatibility but a larger size, and an experience range of 100 to 300 KB is relatively stable.
  • Cache: if you replace the font file but keep the same file name, the real device may read an old cache; adding a version parameter or changing the file name is more reliable.
  • Path: when @font-face in wxss uses a local relative path, compatibility may differ across platform versions; check against the official documentation. The safer approach is base64 inline or a network address.

A common scene at delivery is: the project has only one week left, design provides an existing iconfont package, development puts it directly into the mini program directory, everything looks normal in DevTools, and it is submitted for testing; after release on real devices, some Android models show blank icons because the font used woff2 with no fallback. The cost is rebuilding the package and going through review again, taking two or three more days than before. According to team project delivery habits, the tighter the constraints, the more you should check the font item on two or three real devices before submitting for testing; by experience range, this step usually takes an extra half day to one day, but it avoids a round of rework.

A “four-step check” troubleshooting order

The troubleshooting order matters more than troubleshooting tricks. Checking from “did it arrive” to “does it match” and then “is it stable” prevents starting by adjusting style properties and spending a long time only to find the root cause is in the domain whitelist. The four steps below are arranged in the actual execution order used in projects.

  1. Step one, see whether the font is really delivered. Connect the real device to the debugging panel and check whether the font file initiates a request and whether the status code is normal; for local paths, confirm the file is actually packaged.
  2. Step two, see whether characters and glyphs match. Check the font package version against the Unicode mapping in the code, and update them together when replacing the package so code points do not drift.
  3. Step three, see format and size. Prefer a format with broader compatibility and compress the size into the experience range; if it exceeds that, subset it and keep only the glyphs used.
  4. Step four, see the fallback. Check whether key icons are inlined, whether the first screen has placeholders, and whether an exception will cause an entire row of blank space on the page.

Among the four steps, the first two determine “whether it can display,” and the last two determine “whether it displays stably.” Many projects do only the first two steps, and after release they see occasional blank icons on weak networks or old models, which becomes an online issue again. According to delivery acceptance habits, the font item should go into the self-check list together with APIs and permissions, rather than waiting for user screenshot feedback.

How to choose between font icons, SVG slices, and inline base64

There is no universal answer among the three approaches; it depends on the number of icons, whether colors need to change with state, and the package budget. The judgment can be simple: if there are fewer than ten icons and colors are fixed, there is no need to introduce a font loading path just to save a few KB; if there are dozens of icons and colors must follow the theme, the advantage of font icons becomes obvious.

  • Font icons: small size, easy color changes, clear at multiple sizes; the cost is dependence on loading, cross-platform format differences, and relatively weak accessibility support.
  • SVG or sliced images: stable display and no dependence on font loading; the cost is that color changes require multiple resource sets, and package size grows with the number of icons.
  • Inline base64: no network request and stable loading; the cost is a larger style file and slightly slower first parse, suitable for a small number of key icons.
  • Mixed approach: inline key icons on the first screen, and use fonts or sliced images for the rest, balancing first-screen appearance and package size.

On the cost dimension, font icons have low upfront investment, and later changes mainly mean replacing the package; sliced-image approaches require multiple resource sets upfront, and every additional icon later needs design cooperation. According to project delivery habits in 2026, for projects with tight schedules and icons that will be frequently added, font icons plus inline fallback are usually easier; for projects where icons are basically finalized and stability comes first, using SVG directly is acceptable. The experience range that can be checked is: font icon packages commonly fall within 100 to 300 KB, and for sliced-image approaches, each additional color resource set increases package size accordingly; real-device verification after replacing a font package commonly takes half a day to one day, and producing multiple sliced-image resource sets commonly takes one to two days, subject to the project's actual resources.

Applicable scenarios and boundaries

Scenarios suitable for font icons: there are many icons, colors need to follow themes or states, the design style is unified, and the team is willing to verify the loading path on a real device before submitting for testing. For such projects, font icons benefit both package size and color-change efficiency.

Scenarios where they are unnecessary: the whole site has only three to five fixed icons, and colors and sizes do not change; or the page itself is a low-frequency entry point with low first-screen appearance requirements; or the project schedule is too tight to have real-device verification conditions. In these cases, use sliced images directly, reducing the font loading segment and also reducing one class of online issues. The boundary can be remembered in one sentence: few and fixed icons use images; many icons that need color changes use fonts, but you must accept that it adds one more loading path.

FAQ

If the font file is placed in the mini program's local directory, does the real device still need domain configuration?

A local path generally does not go through the network, so domain configuration is usually unnecessary; once it is changed to a network address, the domain where the font is located must be added to downloadFile valid domains, and if it is missing, loading will fail silently.

The first-screen icons flash blank for a moment — is that acceptable?

It can be acceptable, but a placeholder is needed. A common approach is to give the icon container a fixed width and height and use a light-colored block as a placeholder first, or inline key first-screen icons, so an entire row of blank space does not make the page look unloaded.

After replacing with a new iconfont package, some icons become other shapes — why?

Most often the code points changed while the code still hard-codes old code points. When replacing the package, check the Unicode mapping table at the same time, or use semantic class names as a mapping layer to reduce rework caused by code point drift.

Can screen readers read icons made with fonts?

By default, they cannot. A common approach is to add aria-label or an adjacent text label to the icon container, and hide purely decorative icons from screen readers, so icons do not carry information alone.

Icon positions differ by one or two pixels between Android and iOS — should each be adjusted?

No need. Baseline differences in font icons are common; unify them with a consistent line-height and vertical-align. Handle them separately only when they appear inside buttons and affect the clickable area.


If you are stuck on this kind of problem right now, first do one thing: take two real devices, one newer iPhone and one older Android, and run the font item through the four-step check, then decide whether to fix loading or change the approach. For projects with few icons and fixed colors, switching to sliced images is often easier than continuing to adjust fonts; for projects with many icons that need color changes, write the base64 fallback into the delivery checklist. The above judgment is based on common project delivery experience; the specific result should still be subject to each platform's official documentation and the acceptance criteria at the time.

Interested in this topic?
10-year tech team — reference proposal within 24 hours
Obtain Proposal
Are you ready?
Then reach out to us!
+86-13370032918
Discover more services, feel free to contact us anytime.
Please fill in your requirements
What services would you like us to provide for you?
Your Budget
ct.
Our WeChat
Professional technical solutions
Phone
+86-13370032918 (Manager Jin)
The phone is busy or unavailable; feel free to add me on WeChat.
E-mail
349077570@qq.com
Submitted successfully
Thank you for your trust. We will contact you soon!
Recommended projects for you