Author Topic: Export as HTML, RTF, ...  (Read 29218 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #15 on: October 18, 2005, 04:11:46 pm »
Quote from: squizzz
I'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: squizzz
Anyway, great thanks for the plugin. :D

Heh, no problem :)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #16 on: October 21, 2005, 04:27:47 am »
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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Export as HTML, RTF, ...
« Reply #17 on: October 21, 2005, 09:18:09 am »
Quote
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).

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...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #18 on: October 21, 2005, 06:09:55 pm »
Quote from: mandrav
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.

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...
« Last Edit: October 21, 2005, 07:56:58 pm by Ceniza »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Export as HTML, RTF, ...
« Reply #19 on: October 21, 2005, 07:44:27 pm »
There are a lot of styles in scintilla, depending on the language.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #20 on: October 21, 2005, 08:11:15 pm »
Quote from: rickg22
There 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?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #21 on: October 22, 2005, 12:04:56 am »
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.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Export as HTML, RTF, ...
« Reply #22 on: October 22, 2005, 12:45:31 am »
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.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #23 on: October 22, 2005, 03:14:05 am »
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." :)

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Export as HTML, RTF, ...
« Reply #24 on: October 22, 2005, 03:21:11 am »
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).

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #25 on: October 23, 2005, 11:49:41 pm »
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.

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: Export as HTML, RTF, ...
« Reply #26 on: October 24, 2005, 02:24:28 am »
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?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Export as HTML, RTF, ...
« Reply #27 on: October 24, 2005, 03:57:44 am »
Quote from: takeshimiya
In 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: takeshimiya
For 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).

Offline utelle

  • Single posting newcomer
  • *
  • Posts: 9
Re: Export as HTML, RTF, ...
« Reply #28 on: October 27, 2005, 04:46:14 pm »
All 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: Ceniza
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.
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)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Export as HTML, RTF, ...
« Reply #29 on: October 27, 2005, 05:28:39 pm »
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."