Changeset View
Standalone View
core/textpage.cpp
Show First 20 Lines • Show All 1871 Lines • ▼ Show 20 Line(s) | 1808 | { | |||
---|---|---|---|---|---|
1872 | return tmp; | 1872 | return tmp; | ||
1873 | } | 1873 | } | ||
1874 | 1874 | | |||
1875 | /** | 1875 | /** | ||
1876 | * Correct the textOrder, all layout recognition works here | 1876 | * Correct the textOrder, all layout recognition works here | ||
1877 | */ | 1877 | */ | ||
1878 | void TextPagePrivate::correctTextOrder() | 1878 | void TextPagePrivate::correctTextOrder() | ||
1879 | { | 1879 | { | ||
1880 | //m_page->m_page->width() and m_page->m_page->height() are in pixels at | 1880 | // m_page->width() and m_page->height() are in pixels at | ||
davidhurka: This is some interesting information, which should be documented more visible. Is the… | |||||
aacid: Why should it documented more visible? Who else cares? | |||||
Looks like I messed up my comments.
belongs only to line 1880: // m_page->width() and m_page->height() are in pixels at //100% zoom level, and thus depend on display DPI. (Information from line 1880) Should be documented because any Generator has to return the page size at some time. When I was reading about Generator implementation, I wondered what this size should be, and how it is related to the pixmap size. Should I think in 1px/pt? 1px/mm? A completely different unit? This (line 1880) is not directly about the Generator, but it might be interesting what will be considered “default size” after the Generator returned the page size. davidhurka: Looks like I messed up my comments.
> This is some interesting information, which should be… | |||||
aacid: pagesSizeMetric defines what pagesize means for your generator. | |||||
Ok, if it is documented directly in Generator, it should be sufficient. Maybe I was looking at PageSize only. davidhurka: Ok, if it is documented directly in Generator, it should be sufficient. Maybe I was looking at… | |||||
1881 | //100% zoom level, and thus depend on display DPI. We scale pageWidth and | 1881 | // 100% zoom level, and thus depend on display DPI. | ||
1882 | //pageHeight to remove the dependence. Otherwise bugs would be more difficult | 1882 | // To avoid Okular failing on lowDPI displays, | ||
1883 | //to reproduce and Okular could fail in extreme cases like a large TV with low DPI. | 1883 | // we scale pageWidth and pageHeight so their sum equals 2000. | ||
Is this enough for documents with high text density? At least, this is a good reason for NormalizedRect::roundedGeometry(). davidhurka: Is this enough for documents with high text density? At least, this is a good reason for… | |||||
1884 | const double scalingFactor = 2000.0 / (m_page->width() + m_page->height()); | 1884 | const double scalingFactor = 2000.0 / (m_page->width() + m_page->height()); | ||
1885 | const int pageWidth = (int) (scalingFactor * m_page->width() ); | 1885 | const int pageWidth = (int) (scalingFactor * m_page->width() ); | ||
1886 | const int pageHeight = (int) (scalingFactor * m_page->height()); | 1886 | const int pageHeight = (int) (scalingFactor * m_page->height()); | ||
1887 | 1887 | | |||
1888 | TextList characters = m_words; | 1888 | TextList characters = m_words; | ||
1889 | 1889 | | |||
1890 | /** | 1890 | /** | ||
1891 | * Remove spaces from the text | 1891 | * Remove spaces from the text | ||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |
This is some interesting information, which should be documented more visible. Is the information still true?