[英]How to set different Font sizes for different iPhone screen size using storyboard?
[英]How to get font sizes of recognized text to Recognize Name using font size on the Business Card form the Recognized text using OCR: iPhone
我已經使用OCR通過iPhone實現了Business Card Reader App。
Tesseract庫是一個開源庫。 API
主要議程是何時從名片中識別文本。 我需要將名稱和電子郵件地址以及電話號碼傳遞到相應的字段。
我用他們的表達式格式來做電子郵件地址和電話號碼。
但如果是NAME,則其他一些文本具有相同的格式 ,因此我們可以使用字體大小來選擇它
How to get font sizes of recognized text to Recognize Name using font size on the Business Card form the Recognized text using OCR...?
試試這個-
UIFont *font = totalLabel.font;
CGFloat maxHeight = font.lineHeight * totalLabel.numberOfLines;
CGFloat maxWidth = totalLabel.frame.size.width;
CGSize size = [totalLabel.text sizeWithFont:font constrainedToSize:(CGSize){maxWidth, maxHeight} lineBreakMode:totalLabel.lineBreakMode];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.