Skip to main content
Participating Frequently
October 15, 2018
Answered

IGraphicsPort::xshow method not working in InDesign

  • October 15, 2018
  • 1 reply
  • 724 views

Hello Everyone,

My Requirement is i want to draw string in table cell  in the c++.I am referring cellPanel InDesign SDK sample.

when i am using IGraphicsPort::show  method its working fine.But i want to use IGraphicsPort::xshow method using this method i am not able to draw string in table cell.

Syntax: virtual void show  ( const PMReal &  x,  const PMReal &  y,   uint32  numUTF16s,  const textchar *  text,bool16  verticalGlyphs = kFalse,bool16  wmodePositioning = kFalse)

Example: grPort->show(ix + 2, iy + fCellHeight - 2, s.NumUTF16TextChars(), s.GrabUTF16Buffer(nil)); //working fine

Syntax: virtual void xshow ( const PMReal &  x,const PMReal &  y,uint32  numGlyphs,const int32 *  glyphArray,const float *  widths,  const float *  yoffsets = nil, TextGraphicsFlags  graphicsflags = kFillText, bool16  verticalGlyphs = kFalse,  bool16  wmodePositioning = kFalse, uint32  numChars = 0, const textchar *  text = nil, K2Vector< OneOTFeature > *  otFeatureArray = nil)

Example:grPort->xshow(ix + 2, iy + fCellHeight - 2, 0, glyphArray, widths, offset, IGraphicsPort::TextGraphicsFlags::kClipText, kFalse, kFalse, 1, s.GrabUTF16Buffer(nil), nil); //not working

Please help me on this.

Thanks,

Yogita

This topic has been closed for replies.
Correct answer Markus Freitag

Hi Yogita,

I did not use xshow, but I guess with numGlyphs=0 there is no glyph and so there is nothing to draw.

Markus

1 reply

Markus FreitagCorrect answer
Inspiring
October 16, 2018

Hi Yogita,

I did not use xshow, but I guess with numGlyphs=0 there is no glyph and so there is nothing to draw.

Markus

Participating Frequently
October 16, 2018

Hi,

Thanks for reply.

When i assign value to numGlyphs = 1 or any value  then my code crashes on the gPort ->xshow call with an Unhandled exception error.

I don't know why.

Inspiring
October 16, 2018

Hi Yogita,

I think your glyphArray must contain numGlyphs glyph elements and may be widths and yoffsets too.

Markus