News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Export as HTML, RTF, ...

Started by Ceniza, October 13, 2005, 02:04:43 AM

Previous topic - Next topic

Ceniza

Quote from: squizzzI'm afraid that everything XML-based is bloated by default. The good thing is that it usually compresses very well (*.odt uses zip compression I think).

Well, I'll have to take a deeper look at it. All I know now about its structure is it's compressed in ZIP format, composed of a few XML files and some folders... and OOo ouput is really bloated for this format.

I'll just get the specs file and play a bit, but later.

Quote from: squizzzAnyway, great thanks for the plugin. :D

Heh, no problem :)

Ceniza

Well, well, well, ...

RTF support has been added to the plugin. It seems to be working fine but I cannot say it's bugless (I'm kinda tired) :P

Dealing with it I found there's no OptionColor object with value 11 in Code::Blocks' C/C++ color theme and it's used everywhere in wxScintilla (at least everywhere no special formatting is applied to the text).

Is that somehow intentional or did I, or a developer, miss something?

Anyway, it's already committed to CVS if anyone feels like trying it.

mandrav

QuoteDealing with it I found there's no OptionColor object with value 11 in Code::Blocks' C/C++ color theme and it's used everywhere in wxScintilla (at least everywhere no special formatting is applied to the text).

11 is for "identifier". This means, according to my tests, every word that is not a keyword. So, we use the default text attributes for it.
Be patient!
This bug will be fixed soon...

Ceniza

#18
Quote from: mandrav11 is for "identifier". This means, according to my tests, every word that is not a keyword. So, we use the default text attributes for it.

But... 11 is not in OptionColor, so it, being undefined there, is just used for "default"?

My solution was: if the style is not found select the default.

I still wonder why using a style that isn't there...

rickg22

There are a lot of styles in scintilla, depending on the language.

Ceniza

Quote from: rickg22There are a lot of styles in scintilla, depending on the language.

I'm talking specifically about the C/C++ syntax highlighting.

I found all the styles (I use the word style to refer to the specific color and text formatting of an item, being an item a keyword, a string, a number, ...) are stored in a struct named ObjectColor in Code::Blocks.

That struct holds its name, value, foreground, background, bold, italic, underline and if it's a style.

The variable value holds the style number used by wxScintilla. In other words, it's the key that maps a specific formatting with its stored value in wxScintilla.

The thing is: wxScintilla is using a style with value 11 for identifiers, which isn't in any of those ObjectColor for the C/C++ color theme.

By not being there it should become the default style (and the default style happen to exist in ObjectColor).

The question is: leaving style 11 out of ObjectColor was intentional just to make it map to default?

Ceniza

I would like to inform you I've already started playing with the ODT format and I've got all I need to start making the plugin, except time.

I really wanna get this third format working so I'll try to get some time for it soon.

What do you think of PDF as a fourth format? I'd need to start playing with it too, but I think it would be nice.

rickg22

eew! PDF!  :| Well, I guess it's the users' choice. But don't be too quick on implementing features if nobody has asked for them.

Ceniza

Well, I considered PDF 'cause it's a popular one, almost like HTML and RTF are (please, don't go off-topic about this sentence).

ODT in the other hand was a feature request (or format request :P) which is good, I think.

Imagine: "Code::Blocks... the first IDE to support ODT file exporting." :)

takeshimiya

Yeah, and try to support what SciTE supports, so one would have less reasons for using SciTe and more for using C::B  :)

Namely: HTML, RTF, PDF, LaTeX, XML export support.

Off-topic: Regarding SciTE, I would like to see C::B scripting in lua embedded, just like SciTE does (using it for macros, extended functionality, etc).

Ceniza

I've just finished the first version of the ODT exporter.

I've exported a few files and checked how they look and it seems to be working fine so far.

The PDF exporter could be released soon thanks to wxPdfDocument @ wxCode. The drawback I've found is I'd have to force the font to be Courier or any other working one.

Well, I'll just commit it.

takeshimiya

In PDF? But you can't embedd fonts inside a PDF (I don't remember well, but PDF wasn't a vectorial format?).

For ODT also, you can't embedd fonts?

Ceniza

Quote from: takeshimiyaIn PDF? But you can't embedd fonts inside a PDF (I don't remember well, but PDF wasn't a vectorial format?).

All I know is wxPdfDocument has limited font support. I tried Courier and it works fine (but it knows nothing about "Courier New"). In fact, SciTE uses Helvetica as output for PDFs. wxPdfDocument developers seem to be working in some kind of solution, but I don't know the details.

PDF has support for vector graphics and the text is stored as such (or at least that says Wikipedia).

Quote from: takeshimiyaFor ODT also, you can't embedd fonts?

No idea, but just adding their name in the styles file was enough (as far as you have it installed).

utelle

Quote from: Ceniza on October 24, 2005, 03:57:44 AMAll I know is wxPdfDocument has limited font support.
That's not exactly true. By default wxPdfDocument supports the standard Adobe fonts, i.e. Courier, Times, Helvetica (=Arial), Symbol and ZapfDingBats. Additionally Type1, TrueType and TrueTypeUnicode fonts are supported if the user provides at least font metric files. Usually these fonts have to be embedded in the PDF document. What's missing in the current version of wxPdfDocument is a tool to create these font metrics files from AFM or TTF files.
Quote from: CenizaI tried Courier and it works fine (but it knows nothing about "Courier New"). In fact, SciTE uses Helvetica as output for PDFs. wxPdfDocument developers seem to be working in some kind of solution, but I don't know the details.
Courier New is essentially Courier, no need to embed the font Courier New unless you need Unicode or foreign language support; Helvetica should work without problems, too.

As the font example which comes with wxPdfDocument shows font embedding works. And the next version will include a tool to create the necessary font metric files. The release of the next version is planned for November.

Regards,

Ulrich
(Developer of wxPdfDocument)

thomas

I would be very very careful about embedding fonts or font-related information in a PDF.

Certain companies can be get very nasty if you do that. Remember some companies even regard adjusting character stem widths or the mere drawing of cubic bezier curves as a violation of intellectual property.

It is really hilarious, but remember what happened to Dmitry Sklyarov after the DefCon 2001, too.
They might actually arrest you because you write software that enables the unauthorized copying of font metrics...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."