Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a read-aloud screen: phrases, tappable words and a finger that drifts

Background A lot of what I read is still on paper: letters from the bank, school handouts, a recipe, a library book. I often want to listen to them instead, and I want to follow the words while I listen, so my eyes have something to hold on to. So I built Outloud Reader. You take a photo of a printed page (or open a PDF, or paste text), the app reads it out loud, and the phrase being spoken is…

The concept of building a read-aloud screen with features like highlighted phrases, tappable words, and a "just listen" mode emerged from the desire to hear written content while following along visually. Outloud Reader is an iOS and Android app that accomplishes this by taking a photo of a printed page, or opening a PDF or pasting text, and reading it aloud with highlighted phrases. The app can also translate pages beforehand.

The reading screen proved to be the most challenging aspect of the app. The desired features included having the current phrase highlighted, the current sentence easily identifiable, and the rest of the page looking calm. Users should be able to tap any word to jump to that point in the audio, and there should be a "just listen" mode where the text is hidden. The app should also work for languages such as Japanese, Chinese, and Thai, treating them like any other language.

Initially, the developer considered word-by-word highlighting, but found it exhausting to watch as the highlight jumped around too much. They then experimented with using a UIKit text view as the base, due to its text selection and word hit-testing capabilities. However, they faced difficulties in achieving the specific visual look they wanted for the highlight.

The solution the developer ultimately settled on was to highlight phrases instead of words. A phrase consists of a few words up to the next punctuation mark, with a maximum of four words. The highlight is represented as a soft yellow plate, with the current sentence in full black and the rest of the page greyed out. Each word is its own view, allowing it to be tapped to jump to that point in the audio.

The layout of the words is handled by a custom SwiftUI Layout, allowing for precise control over line-breaking and hit-testing. To ensure smooth highlighting without creating thin white hairlines between words, neighboring plates are allowed to overlap slightly.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Ctrl+A Only Copied a Third of the Page, So I Built a Chrome Extension

I was trying to save a lesson from an interactive course into my notes. You know the type. Slides you click through, cards you flip to see the answer, boxes that open up when you tap them, plus the…

  • Developer created Chrome extension to copy hidden content from web pages
  • Script traverses every text node on the page to extract all content
  • Extension outputs rough markdown for easy pasting into note-taking apps

Docker Compose build must be a string, in CI

Docker Compose build must be a string is the schema validator naming one branch of a rule with two, and following it literally will send you to rewrite a mapping that was never the problem.

  • "Docker Compose build must be a string" error occurs
  • Invalid key type or mapping branch causes the error
  • Validate Compose files in CI to prevent the error

How to Sync Billing Data to Prisma Postgres (Stripe, QuickBooks, Xero & Paddle)

Sync Stripe, QuickBooks, Xero or Paddle into Prisma Postgres. Which connection string to use, how a batched sync counts operations, and what it costs.

  • Prisma Postgres bills per operation, not query duration, making it cost-effective for batch syncs
  • Recommended pooled connection string for background workers like scheduled syncs
  • Sync of 375 Stripe paymentintents costs only 15 operations, demonstrating efficiency

Korean input kept breaking in Android terminals with a physical keyboard, so I built my own

I use a tablet with a physical keyboard and Gboard. Every time I typed Korean into an Android terminal app, composing input broke — syllables got eaten mid-composition or committed wrong.

  • User experiences Korean IME breaking in Android terminals with physical keyboard
  • Developer creates TermiPlus to solve Korean input issues
  • TermiPlus offers Korean input, SSH, and local terminal functionality

My Entire Company Costs About $10 a Year. Here's Every Line Item.

My company made about as much as it cost to exist, and it had a subscription habit: tools I used once and kept paying for.

  • $10 annual cost includes domain, cloud services, email, and Gumroad fees
  • Free tiers from Cloudflare, Brevo, and Gumroad cover all expenses
  • Building trust with customers is the real challenge beyond the $10 stack

More from Sunday 15 November →