GithubHelp home page GithubHelp logo

Print Function? about xi-mac HOT 4 OPEN

xi-editor avatar xi-editor commented on September 26, 2024
Print Function?

from xi-mac.

Comments (4)

raphlinus avatar raphlinus commented on September 26, 2024

It used to kinda sorta work (but not very well) because we were drawing the text with Core Graphics. Now that we draw using a fast text plane, it's not surprising that even this has regressed.

It seems like a useful feature. It's not exactly trivial, because the front-end does not generally have the entire document available, but something basic could probably be wired up.

from xi-mac.

cmyr avatar cmyr commented on September 26, 2024

And we should disable the print menu item pending a fix.

from xi-mac.

vlovich avatar vlovich commented on September 26, 2024

Hmm... this seems like a deceptively hard problem to actually get right.

  1. The entire document needs to be rendered. Does the front-end have a mechanism for getting + rendering anything more than the current view?
  2. Plugins that add style information to a document (e.g. syntax colouring). How will we know when they're in a steady-state? Maybe we need some kind of versioning system so that print takes a snapshot of the rope & we wait for all the plugins to report finished on that version? What happens if a plugin is taking too long? If we cut it off the text would be rendered potentially in an inconsistent state. If we don't then the printing would block waiting for the plugin...

from xi-mac.

raphlinus avatar raphlinus commented on September 26, 2024

Agree with both concerns. We used to have a sync RPC to render lines, and this could be used, but ultimately I think this is best not handled in the front-end, as the front-end protocol doesn't have ways of accessing a consistent snapshot, knowing when the plug-ins have quiesced, etc. Of course, that means adding those features to the plug-in interface, as well as access to the style info.

from xi-mac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.