OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/fpdfdoc/fpdf_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
8 #include "../../include/fpdfdoc/fpdf_vt.h" | 8 #include "../../include/fpdfdoc/fpdf_vt.h" |
9 #include "pdf_vt.h" | 9 #include "pdf_vt.h" |
10 const uint8_t gFontSizeSteps[] = {4, 6, 8, 9, 10, 12, 14, 18, 20, | 10 const uint8_t gFontSizeSteps[] = {4, 6, 8, 9, 10, 12, 14, 18, 20, |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 (word >= 0x1E00 && word <= 0x1EFF) || | 423 (word >= 0x1E00 && word <= 0x1EFF) || |
424 (word >= 0x2C60 && word <= 0x2C7F) || | 424 (word >= 0x2C60 && word <= 0x2C7F) || |
425 (word >= 0xA720 && word <= 0xA7FF) || | 425 (word >= 0xA720 && word <= 0xA7FF) || |
426 (word >= 0xFF21 && word <= 0xFF3A) || | 426 (word >= 0xFF21 && word <= 0xFF3A) || |
427 (word >= 0xFF41 && word <= 0xFF5A)) { | 427 (word >= 0xFF41 && word <= 0xFF5A)) { |
428 return TRUE; | 428 return TRUE; |
429 } | 429 } |
430 return FALSE; | 430 return FALSE; |
431 } | 431 } |
432 static FX_BOOL IsDigit(FX_DWORD word) { | 432 static FX_BOOL IsDigit(FX_DWORD word) { |
433 return (word >= 0x0030 && word <= 0x0039) ? TRUE : FALSE; | 433 return word >= 0x0030 && word <= 0x0039; |
434 } | 434 } |
435 static FX_BOOL IsCJK(FX_DWORD word) { | 435 static FX_BOOL IsCJK(FX_DWORD word) { |
436 if ((word >= 0x1100 && word <= 0x11FF) || | 436 if ((word >= 0x1100 && word <= 0x11FF) || |
437 (word >= 0x2E80 && word <= 0x2FFF) || | 437 (word >= 0x2E80 && word <= 0x2FFF) || |
438 (word >= 0x3040 && word <= 0x9FBF) || | 438 (word >= 0x3040 && word <= 0x9FBF) || |
439 (word >= 0xAC00 && word <= 0xD7AF) || | 439 (word >= 0xAC00 && word <= 0xD7AF) || |
440 (word >= 0xF900 && word <= 0xFAFF) || | 440 (word >= 0xF900 && word <= 0xFAFF) || |
441 (word >= 0xFE30 && word <= 0xFE4F) || | 441 (word >= 0xFE30 && word <= 0xFE4F) || |
442 (word >= 0x20000 && word <= 0x2A6DF) || | 442 (word >= 0x20000 && word <= 0x2A6DF) || |
443 (word >= 0x2F800 && word <= 0x2FA1F)) { | 443 (word >= 0x2F800 && word <= 0x2FA1F)) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 static FX_BOOL IsPrefixSymbol(FX_WORD word) { | 535 static FX_BOOL IsPrefixSymbol(FX_WORD word) { |
536 if (IsCurrencySymbol(word)) { | 536 if (IsCurrencySymbol(word)) { |
537 return TRUE; | 537 return TRUE; |
538 } | 538 } |
539 if (word == 0x2116) { | 539 if (word == 0x2116) { |
540 return TRUE; | 540 return TRUE; |
541 } | 541 } |
542 return FALSE; | 542 return FALSE; |
543 } | 543 } |
544 static FX_BOOL IsSpace(FX_WORD word) { | 544 static FX_BOOL IsSpace(FX_WORD word) { |
545 return (word == 0x0020 || word == 0x3000) ? TRUE : FALSE; | 545 return word == 0x0020 || word == 0x3000; |
546 } | 546 } |
547 static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord) { | 547 static FX_BOOL NeedDivision(FX_WORD prevWord, FX_WORD curWord) { |
548 if ((IsLatin(prevWord) || IsDigit(prevWord)) && | 548 if ((IsLatin(prevWord) || IsDigit(prevWord)) && |
549 (IsLatin(curWord) || IsDigit(curWord))) { | 549 (IsLatin(curWord) || IsDigit(curWord))) { |
550 return FALSE; | 550 return FALSE; |
551 } | 551 } |
552 if (IsSpace(curWord) || IsPunctuation(curWord)) { | 552 if (IsSpace(curWord) || IsPunctuation(curWord)) { |
553 return FALSE; | 553 return FALSE; |
554 } | 554 } |
555 if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) { | 555 if (IsConnectiveSymbol(prevWord) || IsConnectiveSymbol(curWord)) { |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 if (pSection->m_SecInfo.pSecProps) { | 1821 if (pSection->m_SecInfo.pSecProps) { |
1822 *pSection->m_SecInfo.pSecProps = section.SecProps; | 1822 *pSection->m_SecInfo.pSecProps = section.SecProps; |
1823 } | 1823 } |
1824 if (pSection->m_SecInfo.pWordProps) { | 1824 if (pSection->m_SecInfo.pWordProps) { |
1825 *pSection->m_SecInfo.pWordProps = section.WordProps; | 1825 *pSection->m_SecInfo.pWordProps = section.WordProps; |
1826 } | 1826 } |
1827 return TRUE; | 1827 return TRUE; |
1828 } | 1828 } |
1829 return FALSE; | 1829 return FALSE; |
1830 } | 1830 } |
OLD | NEW |