MacDownApp/macdown

Polish: Reduce font style jitter, seen when typing

开放

#953 创建于 2018年4月2日

 (1 条评论) (0 个反应) (0 位负责人)Objective-C (930 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (7,686 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

(Feature/polish suggestion, not a bug)

As you type in the editor pane of Macdown, it seems to follow behind slightly, changing each letter to the correct "style" milliseconds later.

When you type in a # heading or in a **bold section**, however, there is a "jitter" that is noticeable and a little distracting.

The effect feels like this, as it jitters each letter you type in to place:

## [M]
## M[y]
## My [h]
## My h[e]
## My he[a]
## My hea[d]
## My head[i]
## My headi[n]
## My headin[g]
## My heading

For paragraphs, quotes, and lists, there's (usually, depends on font) no jitter. This is because the default document type style and the correct local style is the same.

My question is:

  • What level of effort would this be to fix? (2 weeks rewrite the whole text style preview engine? 2 days Tweak the event that prompts the recalculation?)
  • What classes should I look at if I were going to poke around and try to work this out?
  • What are the correct names for these two concepts in the codebase (document default type and styled local type)?
  • Any unexpected side effects I should think about besides perf?

PS. I use this program all the time. Love it. Thanks for making it.

贡献者指南