usbong / UsbongKit

A framework for reading and displaying contents of Usbong Trees
www.usbong.ph
Apache License 2.0
2 stars 1 forks source link

Font color of the words with hints makes the words themselves difficult to read #16

Open masarapmabuhay opened 7 years ago

masarapmabuhay commented 7 years ago

Salut! I noticed that the font color of the words with hints makes the words themselves difficult to read. However, this is not the case in PagTsing (iOS). Therefore, the code in UsbongKit seems not yet updated.

1) UsbongKit 2016-11-07 11 38 37

2) PagTsing 2016-11-07 11 36 50

Merci beaucoup! p.s. incidentally, the .utree of PagTsing (iOS) is not updated as well, because not all words have their definitions.

chrisamanse commented 7 years ago

The code for the hints is located here: https://github.com/usbong/UsbongKit/blob/master/UsbongKit/Nodes/NodeView.swift#L79

There is no easy access to the API yet, but changing this property results in changing the color of the hints.

As for the words not having hints, this is related to #17.

chrisamanse commented 7 years ago

For PagTsing iOS, I manually set the property to dark grey color:

nodeView.hintsColor = .darkGrayColor()

This is possible when creating a custom view controller, but this is proven to be too tedious, which is why I created the API to present a default view controller:

presentViewer(onViewController viewController: UIViewController, withUtreeURL url: NSURL, andData data: UsbongTreeData = UsbongTreeData()) {

Unfortunately, this leaves us with less customizability. I've thought of a solution to make this more customizable by having a data structure UsbongViewer, where we can set any property we want to customize:

let usbongViewer = UsbongViewer(url: treeURL)

// Set properties
usbongViewer.bundles = [] // Pass in In-App Purchase bundles
usbongViewer.defaultBackgroundImage = myImage
usbongViewer.hintsColor = .darkGrayColor()

usbongViewer.present(on: self) // Present utree on top of current view controller

This proposal is found in issue #6.