+;;;###autoload
+(defun make-glyph-code (char &optional face)
+ "Return a glyph code representing char CHAR with face FACE."
+ ;; Due to limitations on Emacs integer values, faces with
+ ;; face id greater that 4091 are silently ignored.
+ (if (and face (<= (face-id face) #xfff))
+ (logior char (lsh (face-id face) 19))
+ char))
+
+;;;###autoload
+(defun glyph-char (glyph)
+ "Return the character of glyph code GLYPH."
+ (logand glyph #x7ffff))
+
+;;;###autoload
+(defun glyph-face (glyph)
+ "Return the face of glyph code GLYPH, or nil if glyph has default face."
+ (let ((face-id (lsh glyph -19)))
+ (and (> face-id 0)
+ (car (delq nil (mapcar (lambda (face)
+ (and (eq (get face 'face) face-id)
+ face))
+ (face-list)))))))
+