font-measurement

Predict pixel-perfect text dimensions for LVGL-based Even Realities G2 layouts.

61|7|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/even-realities/everything-evenhub --skill font-measurement-even-realities
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: font-measurement
Source: https://github.com/even-realities/everything-evenhub/tree/main/skills/font-measurement
Command: npx skills add https://github.com/even-realities/everything-evenhub --skill font-measurement-even-realities

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pixel-accurate font measurement for Even Realities G2 glasses, enabling precise UI layouts by predicting text dimensions that match the LVGL rendering engine.

Core Features & Use Cases

  • Get exact text width for single lines to size containers.
  • Measure wrapped text with a maximum inner width and obtain line counts and overall height.
  • Truncate text to fit within a pixel budget, preserving readable content.
  • Use guidance on padding and borders to ensure content doesn't overflow and scrollbars don't appear.
  • Real-world use: size a label to a 320px wide area, or plan multi-line blocks for dialogs with no layout guesswork.

Quick Start

Measure a sample string to size a text container for a 300px width UI region.

Frequently Asked Questions about font-measurement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure text width for pixel-perfect UI layouts in LVGL?

Pixel-perfect text width measurement in LVGL is achieved by predicting exact text dimensions that match the LVGL rendering engine for Even Realities G2 glasses. You can use the getTextWidth function to calculate single-line widths and size your UI containers accordingly.

How do I calculate multi-line text wrapping height for a fixed-width container?

Multi-line text wrapping height is calculated using the measureTextWrap function with a specified maximum inner width. This function returns the total wrapped text height and line count, allowing you to size dialog or label containers without layout guesswork.

Can I truncate text to fit a specific pixel budget in LVGL?

Yes, you can truncate text to fit a specific pixel budget in LVGL using the pxTruncate function. It trims text to stay within a defined pixel width while preserving readable content, preventing overflow in constrained UI areas.

Do I need the pretext library to measure font dimensions accurately?

Yes, the pretext library is required to perform pixel-accurate font measurement. It provides the underlying functions, such as getTextWidth and measureTextWrap, needed to predict text dimensions that match the LVGL rendering engine.

How do I handle padding and borders when sizing text containers to prevent scrollbars?

To prevent scrollbars and content overflow when sizing text containers, use the Skill's guidance on padding and border adjustments. You must calculate the inner content width separately and account for padding and borders to ensure the text fits properly within the outer container.

Why does my text overflow its container even after measuring single-line width?

Text overflow often occurs when padding and borders are not factored into the container sizing. You must calculate the inner content width using the provided guidance, subtracting padding and border values from the total container width to prevent overflow and scrollbars.