int BookEngineInterface.BEISetFontSize(IntPtr handle, int fontsize) { int result = 0; switch (format) { case BookFormat.coolreader: result = cri.BEISetFontSize(handle, fontsize); break; case BookFormat.poppler: result = pop.BEISetFontSize(handle, fontsize); break; } return(result); }
private IEnumerator updateFont() { setInformation("Updating"); yield return(null); int oldMaxPages = bookEngine.BEIGetPageCount(bookHandle); bookEngine.BEISetFontSize(bookHandle, fontSize); // render a page to force page count update. retrievePageToTexture(currentPage, leftPageTurn); setInformation("Updating."); yield return(null); int newMaxPages = bookEngine.BEIGetPageCount(bookHandle); // Debug.Log ("setting fonh" + fontSize + " " + oldMaxPages + " " + newMaxPages); setInformation("Updating.."); yield return(null); // Try to stay close to the same page. if (oldMaxPages > 0) { currentPage = newMaxPages * currentPage / oldMaxPages; } // Redraw the current page. changePage(0); pageTurnComplete(); setInformation(""); fontSize = bookEngine.BEIGetFontSize(bookHandle); stateChanged(); }