[poppler] cpp/poppler-page.cpp cpp/poppler-page.h cpp/poppler-private.h

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Jul 20 22:30:03 UTC 2018


 cpp/poppler-page.cpp  |    7 +++++++
 cpp/poppler-page.h    |    6 ++++++
 cpp/poppler-private.h |    2 ++
 3 files changed, 15 insertions(+)

New commits:
commit 6c4eaf5642439d87dafa03391441bb3e7f3a98c4
Author: Zsombor Hollay-Horvath <hollay.horvath at gmail.com>
Date:   Sat Jul 21 00:28:50 2018 +0200

    cpp: Add rotation() to text_box
    
    Bug #106562

diff --git a/cpp/poppler-page.cpp b/cpp/poppler-page.cpp
index a4ebfe51..1dfc9c75 100644
--- a/cpp/poppler-page.cpp
+++ b/cpp/poppler-page.cpp
@@ -4,6 +4,7 @@
  * Copyright (C) 2017, Jason Alan Palmer <jalanpalmer at gmail.com>
  * Copyright (C) 2018, Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
  * Copyright (C) 2018, Adam Reichold <adam.reichold at t-online.de>
+ * Copyright (C) 2018, Zsombor Hollay-Horvath <hollay.horvath at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -309,6 +310,11 @@ rectf text_box::bbox() const
     return m_data->bbox;
 }
 
+int text_box::rotation() const
+{
+    return m_data->rotation;
+}
+
 rectf text_box::char_bbox(size_t i) const
 {
     if (i < m_data->char_bboxes.size())
@@ -363,6 +369,7 @@ std::vector<text_box> page::text_list() const
             text_box tb{new text_box_data{
                 ustr,
                 {xMin, yMin, xMax-xMin, yMax-yMin},
+                word->getRotation(),
                 {},
                 word->hasSpaceAfter() == gTrue
             }};
diff --git a/cpp/poppler-page.h b/cpp/poppler-page.h
index 93a13d18..a33192d8 100644
--- a/cpp/poppler-page.h
+++ b/cpp/poppler-page.h
@@ -2,6 +2,7 @@
  * Copyright (C) 2009-2010, Pino Toscano <pino at kde.org>
  * Copyright (C) 2018, Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
  * Copyright (C) 2018, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2018, Zsombor Hollay-Horvath <hollay.horvath at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -43,6 +44,11 @@ public:
     rectf     bbox() const;
 
     /**
+      \since 0.68
+    */
+    int       rotation() const;
+
+    /**
        Get a bbox for the i-th glyph
 
        This method returns a rectf of the bounding box for
diff --git a/cpp/poppler-private.h b/cpp/poppler-private.h
index 501c4fc4..71cf65a4 100644
--- a/cpp/poppler-private.h
+++ b/cpp/poppler-private.h
@@ -6,6 +6,7 @@
  * Copyright (C) 2018, Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
  * Copyright (C) 2018, Adam Reichold <adam.reichold at t-online.de>
  * Copyright (C) 2018 Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2018, Zsombor Hollay-Horvath <hollay.horvath at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -76,6 +77,7 @@ struct text_box_data
 
     ustring text;
     rectf bbox;
+    int rotation;
     std::vector<rectf> char_bboxes;
     bool has_space_after;
 };


More information about the poppler mailing list