是否可以用Emacs中的文本替换边缘位图? [英] Is It Possible To Replace Fringe Bitmaps With Text in Emacs?

查看:110
本文介绍了是否可以用Emacs中的文本替换边缘位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用简单,雅致的文字来替换丑陋的像素箭头,表示截断或包裹的线条(甚至可能是一个不错的unicode字符,像一个 \\\… 省略号)。这是可能吗?

解决方案

不,不是。边缘位图是真正的位图,也就是0/1位的向量,覆盖在边缘上。没有办法直接在边缘上渲染任意的unicode字符。



你可以做的是将unicode字符自己渲染为0/1位图。任何体面的图像编辑器(例如Gimp,Photoshop,Pixelmator,Paint.net等)都可以做到这一点。然后将该位图转换为边缘位图矢量。边缘位图的格式在自定义边缘位图



最终,您可以使用这些位图矢量替换左箭头右箭头(用于截断行), left-curly-arrow right-curly使用函数 define-fringe-bitmap (用于连续行)位图。

然而,我会说这比它值得的更麻烦。边缘是8像素宽,所以你不得不将你美丽的unicode字符挤压成一个8x8位图。这意味着没有子像素渲染,没有别名,没有字节码渲染,没有什么使屏幕上的人物漂亮和花哨。它将像您已经替换的箭头一样丑陋。


I'd love to replace the ugly pixel arrows indicating truncated or wrapped lines with simple, tasteful text (maybe even a nice unicode character, like a \u2026 ellipsis). Is this possible?

解决方案

No, it is not. Fringe "bitmaps" are really bitmaps, that is vectors of 0/1 bits, overlayed over the fringe. There is no way to directly render arbitrary unicode characters onto the fringe.

What you can do, is to render a unicode character into a 0/1 bitmap yourself. Any decent image editor (e.g. Gimp, Photoshop, Pixelmator, Paint.net, etc.) can do this. Then convert this bitmap into an fringe bitmap vector. The format of fringe bitmaps is described in Customizing Fringe Bitmaps.

Eventually you can use these bitmap vectors to replace the left-arrow, right-arrow (for truncated lines), left-curly-arrow, and right-curly-arrow (for continued lines) bitmaps, using the function define-fringe-bitmap.

However, I'd say that this is more hassle than it is worth. The fringe is 8 pixels wide, so you'd have to squeeze your beautiful unicode character into an 8x8 bitmap. This means no subpixel rendering, no aliasing, no bytecode rendering, nothing of what makes characters on the screen nice and fancy. It'd be just as ugly as the arrows you have replaced.

这篇关于是否可以用Emacs中的文本替换边缘位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆