[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Word wrap for non-whitespace-seperated language
From: |
Yuan Fu |
Subject: |
Re: Word wrap for non-whitespace-seperated language |
Date: |
Thu, 5 Mar 2020 17:33:49 -0500 |
I wrote something that works. The goal is to have a word wrap effect for
variable pitch words while breaking not only on white space characters but also
between CJK characters. fill.el doesn’t work because it doesn’t work for
variable pitch fonts, word-wrap doesn’t work because it can’t break between CJK
characters. The key point is to find the place to break, my current method is
forward char until the x position of point exceeds certain value (say 70*7
pixels). This has two flaws: first, forward char-by-char is very slow, although
I added some simple optimizations, the lag is still noticeable even with small
paragraphs. Second, I can’t get the position of point if it goes out of the
window, in which case I need to recenter.
Is there a better way to search forward for a point such that it’s x position
is larger than some value? (Come think of it, is it possible to find a point in
a window by x-y coordinate?) Thanks.
Yuan
- Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language, Eli Zaretskii, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language, Eli Zaretskii, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language, Eli Zaretskii, 2020/03/04
- Re: Word wrap for non-whitespace-seperated language,
Yuan Fu <=
- RE: Word wrap for non-whitespace-seperated language, Drew Adams, 2020/03/05
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/05
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/05
- Re: Word wrap for non-whitespace-seperated language, Richard Stallman, 2020/03/06
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/07
- Re: Word wrap for non-whitespace-seperated language, Eli Zaretskii, 2020/03/07
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/07
- Re: Word wrap for non-whitespace-seperated language, Richard Stallman, 2020/03/08
- Re: Re: Word wrap for non-whitespace-seperated language, Richard Stallman, 2020/03/08
- Re: Word wrap for non-whitespace-seperated language, Yuan Fu, 2020/03/08