Results 1 to 6 of 6

Thread: Extracting fonts boundary in 2D vector point

  1. #1
    Join Date
    Oct 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Extracting fonts boundary in 2D vector point

    Hi guys, I am new to QT. I was wondering if there is a way to get windows font boundary in x, y coordinate using QT.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Extracting fonts boundary in 2D vector point

    What is a "windows font boundary"?

  3. #3
    Join Date
    Oct 2011
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Extracting fonts boundary in 2D vector point

    hi, thnx for ur replying. i mean i need to extract outline of a letter (including inner/outer points in x, y coordinates)

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Extracting fonts boundary in 2D vector point

    There's no way to do this in Qt that I am aware of. Bitmap fonts have no outline as such, just pixels that are on or off. TrueType/OpenType/Postscript Type 1 fonts are described as a mathematical path to trace but each does it differently, and the x/y coordinates don't exist until it is rendered at a certain size on a certain device. To extract the outline from an outline font would be format specific.

    In general terms you could get an outline by rendering a character and running an edge detection algorithm on the bitmap.

    QFontMetrics and QFontMetricsF provide a range of measurements of a font which may help.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Extracting fonts boundary in 2D vector point

    You probably could use QPainterPath::addText() to get the outline, however extracting coordinates from that outline will probably be close to impossible.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Feb 2015
    Posts
    2
    Qt products
    Qt3
    Platforms
    MacOS X

    Default Re: Extracting fonts boundary in 2D vector point

    I am testing 2d barcode font of Word document.Not sure if this would be the correct placement of this thread, but seen the question asked before in here.
    How do I add my two QTextLayouts to the QTextDocument? I've tried to use QTextDocument.setDocumentLayout(), but this takes a QAbstractTextDocument as argument.

Similar Threads

  1. Copying vector of pointers to another vector
    By Momergil in forum Newbie
    Replies: 12
    Last Post: 24th September 2011, 22:09
  2. Replies: 3
    Last Post: 21st June 2011, 19:37
  3. Replies: 1
    Last Post: 3rd December 2009, 14:23
  4. display a plot point by point
    By oswalidos in forum Newbie
    Replies: 32
    Last Post: 13th March 2009, 15:37
  5. how to paint scene point by point
    By elessaar in forum Qt Programming
    Replies: 8
    Last Post: 4th September 2008, 20:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.