I've been working on graphics support in my backend code and have a couple questions.
What are the intended side effects of the TEXT-STYLE-*** methods, if any? Are they solely intended to answer "what-if" questions, e.g., "what would the ascent be if the font was :fixed and :bold ?" Or are they also meant to update the medium's text style attributes, as I see the gtkairo backend doing? Since one can add :before/:after methods on (SETF MEDIUM-TEXT-STYLE) to synchronize the underlying graphics context -- and presumably such a style attribute update necessitates repainting -- is that sufficient or should I really be planning on synchronizing attributes anywhere that styles are passed as arguments?
MEDIUM-DRAW-TEXT* appears to be called for each character in the string to be rendered. I gather that a backend is expected to be able to buffer such operations (see next question). But from looking at backtraces, the cause seems to be CL:WRITE-STRING processing the output stream one char at a time. I'm running on CLISP, so perhaps you lucky SBCL folks have your string output processed in batches. I take it that the use of WRITE-STRING is a consequence of CLIM's stream output model?
More generally regarding output buffering, I see the MEDIUM-FINISH-OUTPUT and MEDIUM-FORCE-OUTPUT methods and can easily imagine how my backend code might implement those. I also notice the public WITH-OUTPUT-BUFFERED macro and that it communicates with the backend by way of MEDIUM-OUTPUT-BUFFERING-P. Based on what I'm seeing so far just with text output, I'm sort of inclined to implement double-buffering unconditionally. Is that a bad idea, or am I missing a level of abstraction between McCLIM's idea of buffering and my backend's idea of buffering?
Thanks.