MacDownApp/macdown

Polish: Reduce font style jitter, seen when typing

Open

#953 建立於 2018年4月2日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Objective-C (7,686 star) (930 fork)batch import
enhancementhelp wanted

描述

(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.

貢獻者指南