Ticket #326 (new 不具合)

Opened 2 years ago

Last modified 2 years ago

画像の :ascent center が正確に中央寄せになっていない。

Reported by: anonymous Assigned to:
Priority: major Milestone:
Component: Emacs Lisp Version: 3.00 (開発中)
Keywords: Cc:

Description

以下の式を評価して画像を表示させると行によって高さが違う。

(let ((img '(image :type pbm :data "P4\n8 8\n\000\377\000\377\000\377\000\377"
                   :ascent center)))
  (dolist (h '(90 105 120 135 150 165 180))
    (insert-image img (propertize "x" 'face `(:height ,h)))))

vertical-centering-font-regexp によらない。

Attachments

Change History

08/08/06 08:19:54 changed by miyoshi

行によって高さが違う

の意味が良く分かりません。補足をお願いします。

08/08/06 23:32:31 changed by anonymous

「行によって高さが違う」ではなく「行の中で画像の表示される高さが違う」でした。

08/09/06 19:27:46 changed by anonymous2

infoによれば

If ASCENT is `center', the image is vertically centered around a centerline which would be the vertical centerline of text drawn at the position of the image, in the manner specified by the text properties and overlays that apply to the image.

とあり(太字は引用者による)、現状の動作が仕様通りだと思います。

08/10/06 01:34:30 changed by anonymous

「画像がない場合に表示されるテキストの高さの中心」と解釈するなら その分の高さを確保して表示するのがしかるべきではないでしょうか?

例えば display (image 小さい画像 :ascent center) face (:height 750) のプロパティがあるとするなら、画像がない場合のテキストの高さは100ドットですが 行の高さは実際には50ドット少々になってしまいます。ここで行の高さとして100ドット を確保した上で画像が50ドットの高さに表示されるのならば合理的だとは思います。

テキストの高さと言っても最初の一文字分しか見ていない点はどうなんだろうか。

また、以上の点を別としてもフォントの表示自体がセンタリングされている (vertical-centering-font-regexp などによる)場合はやはり高さが揃って しかるべきだと思います。

08/15/06 21:59:22 changed by anonymous2

NTEmacsでも同様でしたのでEmacsの仕様だと思われます。

変更すべきという事でしたらemacs-devel等で提案された方がよいと思います。


Add/Change #326 (画像の :ascent center が正確に中央寄せになっていない。)




Change Properties
Action