Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bullet & Numbering #15

Open
qimuxi1990 opened this issue Jan 7, 2019 · 5 comments
Open

Bullet & Numbering #15

qimuxi1990 opened this issue Jan 7, 2019 · 5 comments

Comments

@qimuxi1990
Copy link
Contributor

Dear @iarna
I just discover that fcharset2 Symbol is not supported here.
Due to the fact that it does not related to any window codepage. So it will never be handled by iconv.
However in rtf documents, bullet and numbering are frequently. I believe it would be pretty nice to have support on Symbols or simply Bullet & Numbering.
Here is an example rtf string:

{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}{\f1\fswiss\fprq2\fcharset0 Tahoma;}{\f2\fnil\fcharset2 Symbol;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard{\pntext\f2'B7\tab}{*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb'B7}}\ltrpar\cf1\f0\fs16 Some Text \cf0\f1\fs20 Some text.\cf1\f0\fs16\par \cf0\f1\fs20{\pntext\f2'B7\tab}some text.\cf1\f0\fs16\par }

Same thing possibly also happens to fcharset1 DEFAULT, and fcharset255 OEM. But I have not seen examples from my experience.
Thank you.

@qimuxi1990
Copy link
Contributor Author

Also emoji. I see one emoji is expressed with \u55357?\u56842? which will result in a break in interpreter ctrl$u function.

@iarna
Copy link
Owner

iarna commented Jan 8, 2019

@qimuxi1990 Yeah, I agree! I'd love to see these fixed (my use case has been very limited, thus the overall limited implementation here).

Would you be interested in being co-maintainer of this project? If yes, I'll add you here and on npm! (But you'll have to tell me your npm account name. 😀) Please feel free to email me at [email protected] if you'd like to discuss this before making a decision.

@qimuxi1990
Copy link
Contributor Author

@iarna Thank you very much for inviting me but I think I would not have sufficient time to be a co-maintainer and I did not got an npm account yet. ;-)
However, since the company I am working for is currently building a CRM with RTF support for in-house purpose. I may see more use cases here.
If I witness some common cases or figure out any improvement. I'll also update them here.

@iarna
Copy link
Owner

iarna commented Jan 8, 2019

Yeah, I get that. Mostly I just wanted to give you the ability to land your patches, when you have them, on your own, as my own ability to be here is limited too.

@markb-trustifi
Copy link

markb-trustifi commented Dec 11, 2022

It can be fixed by changing this function:

flushHexStore () {
    if (this.hexStore.length > 0) {
      let charset = this.group.get('charset');
      let hexstr = this.hexStore.map(cmd => cmd.value).join('')
      let translate = charset === 'SYMBOL' ? '&#x'+hexstr+';' : iconv.decode(Buffer.from(hexstr, 'hex'), charset)
      this.group.addContent(new RTFSpan({value: translate}))
      this.hexStore.splice(0)
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants