MIME type handler and selectable text

58 views
Skip to first unread message

Kevin Ward

unread,
Apr 7, 2014, 6:27:25 PM4/7/14
to native-cli...@googlegroups.com
Just getting started with the native client and plan on making a mime type handler similar to Chrome's default PDF plugin.  I've read that requires rendering the view yourself instead of simply generating text or html for the result.  If I'm to render text to graphics for display, will users be able to select text from the resulting page?  I notice I can do that with the default PDF renderer.  If so, what's the best library for a starting point?  Something to render text into my ImageData.

Thanks,
Kevin

Ben Smith

unread,
Apr 8, 2014, 2:06:34 PM4/8/14
to native-cli...@googlegroups.com
Hi Kevin,

Are you porting a specific library, or writing new code?

A Chrome extension with a NaCl mime type handler will automatically generate a new page with a fullscreen NaCl module. The URL of the file to load will be passed to your Instance via the HandleDocumentLoad method. Your module will need to handle all rendering (via Graphics2D or Graphics3D) and input. You will have to handle text selection manually.

One commonly used text rendering library is freetype. You can find a Native Client port of this library at naclports.

-Ben

Andrey Khalyavin

unread,
Apr 14, 2014, 3:04:04 AM4/14/14
to native-cli...@googlegroups.com
You can also read this discussion: https://groups.google.com/d/msg/native-client-discuss/UJu7VXvV_bw/pLc19D50gbwJ

-- Andrey Khalyavin
Reply all
Reply to author
Forward
Message has been deleted
0 new messages